If your question was closed for being off-topic, then you have your answer.
The way your question is worded, it sounds like the "question" is more of a prompt and the "answers" to that "question" are really just demonstrations fitting the prompt. If that's accurate, then that indeed sounds a lot like a Code Golf-like scenario. I would generally find such "questions" off-topic in the Q&A category. If there is a desire for these types of "challenges", it would make sense to have a separate category for them. Personally, I lean against having these even in a separate category.