There is a light bulb inside a room and four switches outside. All switches are currently at off state and only one switch controls the light bulb. You may turn any number of switches on or off any number of times you want. How many times do you need to go into the room to figure out which switch controls the light bulb?
HintA lighted bulb also emits heat, and gets hot slowly (not instantaneously!)
Answer
Solution
I think this puzzle is stupid, but it was asked to my friend in an interview, so I can't skip it. The main point is that bulb gets hot slowly when turned on. Turn on bulb 1 and 2 keeping others off. Wait for 20 minutes. Switch off 2 and turn on 3, quickly enter room and touch the bulb. If the bulb is:
on and hot -> switch 1 controls it
off but hot -> 2
on but cool -> 3
off and cool -> 4