But think of how smart he felt after telling you the answer! That confidence boost alone was probably worth their time to interview you, mission accomplished.
Oh don't worry it wasn't just one question but the whole interview. One I remember was how would I explain [insert random algorithm] to a board of decision makers, I made it sound like I was explaining a 100 year old how to turn on a computer.
I had no interest in ever "explaining" stuff to non-technical people at that time, all I cared about was the code. So I also trolled one of the guys interviewing me since I happened to be stuck with his legacy "code", which made me judge him and take him with absolutely no seriousness: he was one of those "cfa" people who learnt how to "code" a line of VBA and think they're Linus.
I also remember the face of the HR person who was like wtf the whole time and politely told me they had "chosen" another person for the job, I laughed inside and politely answered that I understood.
I recommend against this behaviour to past me anyways ;)
We all have to feel our oats at some point … and then realize later how childish it was / how poorly we treated others … so we can be forgiving of those who come after us …
IMO asking gotcha questions like that to make yourself feel smart is just cringeworthy and silly.
Your goal when interviewing people should be to find things out about them — with gotcha questions you don't find out anything about them, but they find out something negative about you.