You’re absolute right. Let’s put the petty hubris aside. I think we ought to be a little skeptical here, not just of the claims being made, but likewise of the kinds of questions asked during interviews and the ways they’re asked.
First of all, phone interviews or interviews involving coding in a span of a few minutes is generally a terrible idea. While for really simple programs this isn’t much of a problem (the kind where you just have to find a word count in a string or something), for problems where you need a little focus, lots of programmers can’t perform while there’s someone peering over their shoulders or on the other end of the line with them, observing them like a show dog. It’s an artificial situation and it stupidly selects out people who often can put the phone down and produce a solution very quickly right after the phone interview. You’re not applying to be a spy or some guy who needs to write code with a gun pointed at your head.
Personally, I am in favor of having a phone interview just to have a discussion with the interviewee, ask about some work they’ve done in the past, that sort of thing. As far as the technical interview, coding assignments are a better option. Make it a larger assignment than one given over the phone. You want to see how they program in the wild in a realistic setting. Some of the worst code I’ve ever seen was written by people who are great interviewers (many of these are at a certain company we all know that shall not be named). We’re really failing here and part of it point to a lack of common sense and empathy on the part of hiring staff.
Secondly, the questions asked during many interviews aren’t even close to the kinds of problems you really solve as a programmer. Most of it is API plumbing and actually quite boring, relying more on familiarity with particular technologies more than “clever” ways of doing things. As Andy says, recursion seems to be a favorite among interviewers. I personally like those problems, but I have never come across a recursive solution in the wild and so people have no practice with such problems (and you really need practice). There are a lot of reasons: they’re usually unnecessary, they can be very inefficient in many languages such as those lacking TCO or ones where there are limits on the call stack, and in a world where OO dominates, an essentially functional solution can’t or shouldn’t even be used. Certain languages actually discourage recursive solutions an make use of idioms that are anything but.
Last, I’ve not only never come across a question as simple as the ones given above, but I’ve never heard of anyone not being able to loop over something. I just don’t believe it. I really think someone is making things up to get attention.