Questions In Interview

Interview Questions: How can the prisoners tell, with certainty, that all 100 of them have visited the central living room with the light bulb?

The facts of the question: There are 100 prisoners are in solitary cells, unable to see, speak or communicate in any way from those solitary cells with each other. There’s a central living room with one light bulb; the bulb is initially off. No prisoner can see the light bulb from his own cell. Everyday, the warden picks a prisoner at random, and that prisoner goes to the central living room. While there, the prisoner can toggle the bulb if he or she wishes. Also, the prisoner has the option of asserting the claim that all 100 prisoners have been to the living room. If this assertion is false (that is, some prisoners still haven’t been to the living room), all 100 prisoners will be shot for their stupidity. However, if it is indeed true, all prisoners are set free. Thus, the assertion should only be made if the prisoner is 100% certain of its validity.

Before the random picking begins, the prisoners are allowed to get together to discuss a plan.  What plan should they agree on, so that eventually, someone will make a correct assertion?



Strategy and Approach to Answering a Problem Solving (aka Microsoft / Google) Interview Question

If you get asked a problem solving question in an interview, remember that they are NOT looking for the RIGHT answer. They are evaluating the approach you use to think out and solve the problem. A strong candidate demonstrates the following:

  1. Evaluates and understand the scope of the problem
  2. Communicates assumptions
  3. Demonstrates quantitative analytical skills
  4. Answers the question that has been asked. You’d be surprised how many candidates get lost in the analysis and solve for a different question than what was asked.


How to Answer this Question

In evaluation of the problem, there is no limit on the number of times that a prisoner can go into the cell, however the prisoners need a way to communicate with each other on who when into the cell.  Therefore one person is chosen as the counter. If the light switch is on, no prisoner will touch it. If it is off, and a prisoner who has never flicked the switch enters, then he flicks the switch on. It stays like that until the counter returns. The counter never flicks it up, only flicks it down. Once he notices that it’s been flicked up 99 times, he says that 100 prisoners have visited, and they go free.

Note: For this problem solving job interview question, there is an actual logical answer, however the interviewer will want to evaluate your thinking process.  In answering the interview question, the lead up to your answer will be just as important as the actual answer itself.

For more problem solving, brain teasers, riddles, puzzles, logic job interview questions, please check our out Problem Solving Interview Section.


List of Problem Solving (aka Microsoft / Google) Interview Questions