Some talents are easy to capture in an interview. If you're interviewing to be a drafter, questions about your proficiency in AutoCAD (or a similar product) are quite reasonable and help quantify your ability to do the job. However, some talents (typically so called "soft skills") are much harder to test. Sometimes the interviewer wants to see what's underneath the veneer you put on when you entered the interview.
Frankly, no matter what job you are interviewing for, you're going to be put into positions that put pressure on you. They can't test for those specific scenarios because they simply don't know what they will be. Each person's career pits them against different challenges. Instead they have to test for generic skills. One of the effective approaches for testing these skills is to ask questions that are outside of the "comfort zone," forcing you to dig deep.
One famous question is from Google, asking about the resistance between two points on an infinite grid of 1 ohm resistors. This particular problem was very popular on the internet a while back as people looked for solutions to it. However, the purpose of the question was not to see who could get the right answer. It was to give an opportunity for the interviewer to see how you approached such problems. How did you structure your work? Did you get frustrated? All of these are very hard to quantify, and even harder to bake into one single numerical metric, but a skilled interviewer can glean a remarkable amount of information just by watching you operate in such a stressful environment.
As for the task seeming to be "unrelated" to what you are interviewing for, it might indeed be unrelated. However, you may be surprised at how interrelated soft skills can be. As you work the job (assuming you get hired), you may learn to appreciate why that particular test was related.
In an interview with an ex-Blue Man Group actor, I came across a similar interview test for clowns. The test was simple. The clown walked on stage in front of a group of people, said nothing, did nothing. They stood there. When they felt they had made meaningful contact with at least one person, they walked off stage. Given that clowns are almost never just standing still like that, the test might seem unrelated. However, if you dig deeper into the job and understand what a clown actually has to do to accomplish their job, that particular test was surprisingly relevant. Also, if you asked anyone to quantify the results of that test, they would chuckle at you and say "that's not how it works, pal."
You can approach such a question may ways. You can jump into it with both feet, and belt out your best Sinatra, or maybe some Go Go's. Or decide not to let the question touch you at all and instead choose a nice rousing round of "Row Row Row your boat," while gathering yourself to answer the next question perfectly. Or perhaps you ask for clarification as to why you are being asked to sing. The ability to politely ask for clarification at the right moments is a highly prized skill in business. It's a skill that can save millions if applied at the correct moment.
Any way you choose to treat it, the purpose of these curveball questions is to get to see a side of you that would not show past the thin veneer we put on when we go to an interview.Any way you choose to treat it, the purpose of these curveball questions is to get to see a side of you that would not show past the thin veneer we put on when we go to an interview. It's a side that will get out if you get the opportunity to work 9-5 for several years with these people, so they might as well get to know what they're in for! Let them see what you will bring to the table after all those years.