I always urge caution when internets fill with the trendy ire at "puzzle" questions in interviews. Yes, some questions are stupid. Yes, some interviews value the wrong things. Yes actual "brain teasers" and "gotcha" questions as an intelligence test are asinine. Yes, yes, and yes.
But... there are questions that sound very similar to such questions that are perfectly legitimate analogies to various computer science topics. Yes, you might say, "so ask me in computer science terms, not knights and dragons". And my response would be "Why? Do you have trouble with abstractions?". When I mention knights and dragons I'm making it very clear that the answer doesn't require some nuance of the C standard library or some knowledge of the JVM. I'm emphasizing the -abstract- part of the problem, for a reason.
I was so prepared for this question that I already told you why. Because phrasing an algorithm design question in the form of a guy and his quirky light-bulbs is a much simpler, and clearer, platform for focusing the discussion on the aspects of algorithm design. Trying to figure out at which floor a lightbulb breaks (a common question), given only 2 of them, is a very clear description of an -actual- class of computing problems (here hits and misses are not of equal cost) that are far more difficult to explain and far more likely to confuse.
When you start trying to pin these types of questions on "actual" problems you get tons of non-answers. You get distracted, easily. They start worrying about things like libraries, and language issues, and implementation details, etc, etc. And when you try to focus them on the algorithm portion of the question, they get flustered and feel like they are screwing it up.
There is a time and place for stripping away the computer and asking about simple algorithm development to see how people think. People who get offended by abstract problem solving are sending out red flags.
It sounds like we've just had differing experiences. The lightbulb question is a good one.
In my experience, however, most questions are either riddles which you get or don't, or so contrived they'd be easier to explain formally. Good story problems are like rare gems.
Beyond that, phrasing something as a story doesn't solve the problem of people nitpicking, it just changes what they nitpick about. Just read the comments on a blog I wrote a year ago about the lightbulb puzzle: http://20bits.com/articles/interview-questions-two-bowling-b...
For me it boils down to this: I'm interested in good problem solvers, not good puzzle solvers. Being able to solve puzzles is at best a weak indicator of being able to solve problems. I'd rather spend my time looking for stronger signals.
Come on guys, you can enjoy these puzzles for their own sake without freaking out about interviews. That's how this site sees them, too. Start with these: http://www.ocf.berkeley.edu/~wwu/riddles/easy.shtml
It's illegal in the United States to discriminate on a basis that has nothing to do with the job. So if your job doesn't require people with sharp analytical skills (trucking, for example), it would be illegal to use an IQ test. In programming, I doubt it would be illegal.
The reason for this is that people who wanted to exclude black people or women from their workforce would pick some irrelevant trait that the disadvantaged group would score lower on, and use that as the reason not to hire.
Some of these puzzle/problems are stupid, but if you do not know how to solve problems well and frequently you probably will not be a good (let alone excellent) software developer.
These puzzles aren't necessarily used in interviews, and I'm sure that employers who are looking for intelligent employees have several ways of attaining them.