The purpose of the question is[2] to gauge the interviewee's ability to solve problems.
With those constraints your approach would appear to be sub-optimal. Sometimes in life we have[3] to jump through hoops to get what we want.
[1] Primary purpose; there are other things, such as deciding whether the company is a terrible place or full of idiots or etc.
[2] Should be; I accept that maybe many people have heard about these questions and think they're the right thing to ask but have no idea of the purpose.
[3] Or we decide that hoop jumping is not for us and we reject all hoop jumping and politely decline the job.