I'm going to take the contrarian point of view here: partially for the sport of it, and partially because I genuinely think there's value in puzzles and brainteasers -- though I <i>do</i> think the value is limited, circumstantial, and merely one datum out of many in an interview.<p>These questions are about having a logical process, regardless of where it gets you, and spelling that process out in a sequential fashion. It's more important to communicate "I do X, and check for Y. Then I do Y, and check for Z" than it is to arrive at a reasonably accurate Z.
The added component of pressure (i.e., you've only got a few minutes, in the uncomfortable setting of an interview, in which to answer the question) helps (or allegedly helps) detect your ability to remain calm and logical under tight deadlines.<p>Basically, the question is asking "Under pressure, and faced with a seemingly insurmountable problem, will this candidate give up, or will he try to address obstacles in a rational, collected, and systemized fashion?" They're essentially variants on the Kobayashi-Maru test of Star Trek fame.<p>Furthermore, I don't agree with the apparent consensus that oddball "puzzle" questions would be better replaced with more technically relevant brainteasers. That's not the point. You have technical questions to test your technical literacy. These questions are trying to test your character. (Brainteasers are often non-technical precisely because the interviewer doesn't want you to be able to fall back on existing knowledge as an escape hatch from the question). Some brainteaser/puzzle questions are much more inane than others, but the exercise itself isn't entirely worthless.<p>I have never asked a puzzle question in an interview. If I were compelled to do so, I would never hire someone purely on the basis of his or her performance on one. It's one of the least important variables in a hiring process. But I'd consider with some skepticism anyone who outright refuses to answer a brainteaser, or who gets totally flummoxed by one, or who gives up without at least attempting to work out an approach.<p>Ultimately, no single type of interview question is flawless. That's why you have a wide variety in your arsenal. You've got technical questions, case questions, puzzle questions, whiteboard questions, and even the oft-derided "Tell me about a time when..." questions. In isolation, none of these types is sufficient. In combination, they test different aspects of a candidate's thought process and preparation.