Notorious Interview Questions
This chapter contains a number of questions that, in all honesty, you might never be asked at an interview. These interview questions have gained fame or notoriety on the Internet, and are what most people think of when someone mentions an interview at Google, Microsoft, or some other high-tech company. These questions might have been asked once or twice at real interviews sometime in the past but today they are rare, even at Google.
This style of interviewing is falling out of favor because interviewers today look for skills that are more directly relevant to the job of programming—for instance, the ability to write good-quality code.
Nonetheless, these questions are still notable partly because if you happen to be asked one of these and you don't react well, they can transform a smooth interview into a horror show. You should be aware of them, just in case.
Estimating on the Spot
No book about programmer interviews is complete until it answers the question of how many golf balls you can fit into a school bus.
That probably sounds like I'm being funny but actually there is some (just a little) method in the apparent madness. An interviewer who asks you an apparently random question like this has an ulterior motive: He wants to see how you approach a problem that you've probably never thought about prior to the interview. Unless you arrive at an obviously incorrect answer such as √–1 or “infinity,” he won't care what number your calculation ...