Three Switches and Fan Puzzle - Popular Interview Puzzle


 Puzzle Details 

Your room has three switches. One of these switches is for a fan in the next room. You cannot see whether the fan is on or off unless you come out of the room. What is the minimum number of times you may go in a room to identify the correct switch in another room?
This is an interesting interview puzzle asked in a job interview. the interviewer asks this kind of puzzle to encourage a candidate to find a solution creatively to the problem.




I would go only once to the other room to find out the accurate switch for the fan. I would turn on the first switch and keep it on for two-three minutes. Next, I would turn off the first switch and turn on the second one. I would run to the other room as soon as I switched on the second switch.
Here there are three possibilities...
If the fan is running, the second switch is for the fan. If the fan is not running, obviously the second switch is not the right switch,
if the blades are rotating slowly, the first switch corresponds to the fan, it's because the fan will not immediately stop when the switch is turned off, speed will reduce gradually and finally come to stationary and for this It takes time.
If the fan is not running and it is not rotating slowly, that is if the fan is stationary then, the correct switch for the fan is the third one.”
Thus, a minimum number of times you may go in a room to identify the correct switch in another room is just one.

You may like these posts:

No comments:

Post a Comment