There are bad interviewers in almost every company out there. One of those categories is the type that doesn't know the solution to the question they asked and so look up the solution online. Depending on how bad an engineer or interviewer they are, they can be convinced your (candidate's) code has bugs. Now, assuming that you are the interview candidate, how would you navigate this situation without bruising the fragile ego of the interviewer and convince them your solution is right & turn that round in to a success ?
As the interview candidate I would politely end the interview and say that you don’t feel like you would be a good fit for the organization. If they aren’t prepared to set up a proper vetting process how can you be confident they do anything properly or even remotely effectively
Though I partly agree with the argument, it's more valid for small start-ups. Where as with huge corporations, the interviewers aren't even from the same org. It's a bad job by the recruiter, but I believe they just blindly go by the interests or areas of expertise listed by the interviewers.
wouldn’t want to miss a job at google due to one interviewer.
Idk imo just like a lawyer, as an interviewer, you should never ask a question that you don’t know the answer to. I mean effectively how are you evaluating the candidate if you can’t properly critique their responses
It's driven mostly by ego or power-trip or delusion, none of which is in scarce at so called top tier companies. I know someone who asked to be walked out of the interview coz the interviewer was douchy and gave that as the reason to the recruiter. That kind of thing happens quite rarely.
Ask to execute the code during the interview (or take pics for execution later)
That's a good suggestion. Can always offer to get back with corner cases and examples to prove code correctness.