Brainteaser-Type Questions
Sometimes, interviewers ask "brain teaser" type questions to see if you
are creative. I personally don't think it helps to memorize these
questions because there's too many of them to memorize. But, if you happen
to have heard a few of them before an interview, it doesn't hurt, either.
Here's the list I have so far:
- How do you swap two real-numbered variables without using a third
temporary variable?
- What is the fastest way to figure out what number is missing from a
list of numbers from 1 to 100?
- Why are manholes circular?
- There are three light bulbs in a room, and outside the room there are
three switches that control the lights, but you do not know which switch
is connected to which light. You can do anything you want to the switches
before entering the room, and then, upon observing the lights in the room
afterwards, you have to determine which switch goes with which light. How
do you do it?