I forgot to mention, the worst part about trick questions is that you never quite know what's meant to be a trick question and what's not, and handling that gap can be extremely tricky.
For example:
>> Which C++ data structure would you use to store a sorted list of 5,000 integers, a linked list or a vector? The values will be randomly generated one at a time, and after inserting an integer the list must be in a sorted state.
> I would use a vector because of its compact and linear nature. It would-
>> Sorry, the correct answer is a linked list. With an array if you want to insert something in the middle it's going to require you to move all elements that come afterward. Linked lists on the other hand have a constant time cost for insertion and removal.
> But the cost of constant cache misses while traversing the linked list are going to significantly outweigh the cost of shifting the array by one space. And on top of that the 3-4x overhead is going to push nearby nodes out of the cacheline.
>> I'm not convinced.
> We could benchmark it together, or find an existing benchmark online.
>> We're on a strict schedule here, so let's just move on to the next question.
> No thanks, I've realized I wouldn't be a good fit for this position. Thank you for your time and best of luck.
How do you handle a situation like that, where you're asked a trick question but the interviewer doesn't know the trick? It's difficult to find a balance between assertiveness and argumentation.
Do you insist on giving the correct answer and backing it up with facts? Or do you tend toward conflict avoidance, taking the loss on one question and hoping to make it up on the rest?
When you're on a team, you can plan your approach based on the personalities and culture around you. But in an interview you usually have minutes of experience talking to your interviewer. Would they be impressed at your knowledge, confidence, and assertiveness? Or will they perceive your confidence as egotism, your assertiveness as an issue with authority, and your knowledge as incompetence?
The correct answer varies based on the interviewer's personality and your tactfulness, but realistically you need to either stand your ground or walk away. If you acquiesce, you're setting yourself up for a miserable work environment.