## 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?
• There are two rooms, one filled with gold and the other is empty. Each room has a guard. One always lies and the other always tells the truth. The guards know what's behind the rooms, but you don't. You don't know which guard tells the truth and which one lies. How do you find out where the gold is by only asking one question to one of the guards?
• If you look at a person riding a bike on the strett you'll notice that the spokes in the upper half of either wheel go by in a blur whereas the spokes in the lower half are clearer to make out. Therefor you conclude that the spokes in the upper half of the wheel are moving faster than the spokes at the bottom half. Is this really the case and why?