Earlier quoted context omitted.
Asking someone "how many prime numbers are there?" seems pretty valid to me. It's an easy question. The two valid answers are: "a lot" or "infinite" (with "more than 10" also being a fine answer IMO). I'm not sure the interviewer was expecting the actually correct answer here (infinite) - lots of programmers don't know that there are infinite prime numbers - I think he was trying to set up for an explanation of an al…
If the job had been some sort of super low level position requiring a lot of hand written advanced data structures, then I might agree with you. Hashes, priority queues, skip lists, etc all rub up against more math heavy topics (number theory, statistics), so you would expect a candidate to at least have some familiarity with prime numbers. However, for a web framework? Like, primes are pretty simple, but they're als…
The interviewer sounds probably bad. After the person made it clear they didn't know about number theory, they should have moved to a different topic. But still, answering "Optimus prime" just suggests immaturity or even combativeness in the face of a difficult situation, which isn't someone you want to hire. There are a thousand better answers. Even snarky answers are fine as long as the person is meaningfully engaging.
"I don't know. Probably a lot"
"Maybe infinite. I'm not sure."
"It's an interesting question. Am I allowed to look it up?"
(As someone else said) "Definitely more than 10. Outside of that I'm not sure."
"I don't know. But here is how I would write a script to figure it out"
It comes back to the "move mt. fuji" style questions mentioned in the article. The point of an interview is not to determine whether you would be able to move mt. fuji anymore than whether you are able to answer the number of primes. It's about how you communicate and approach a problem. "Optimus prime" is such a non-starter that it doesn't even allow for a discussion.
I'm speaking as someone who passed a google interview and worked there for several years, so there may be some reason to believe my feelings around interview approaches are based in fact.