Comments on: Prisoners and the lightbulb puzzle https://demo.ritambhara.in/prisoners-and-the-lightbulb-puzzle/ Coding / System Design Interviews Sat, 05 Mar 2016 19:30:15 +0000 hourly 1 https://wordpress.org/?v=6.7.2 By: abhiakshi https://demo.ritambhara.in/prisoners-and-the-lightbulb-puzzle/#comment-2003 Sat, 05 Mar 2016 19:30:15 +0000 http://www.ritambhara.in/?p=2940#comment-2003 In reply to Naresh.

how can other prisoner able to differentiate between day and nyt…??

]]>
By: Naresh https://demo.ritambhara.in/prisoners-and-the-lightbulb-puzzle/#comment-2002 Sun, 21 Feb 2016 05:46:58 +0000 http://www.ritambhara.in/?p=2940#comment-2002 In reply to Kamal Rawat.

Since prisoners can count the day they are sent in, the counter person will know that he is the first person and don’t increment the counter on day 1.

]]>
By: Kamal Rawat https://demo.ritambhara.in/prisoners-and-the-lightbulb-puzzle/#comment-2001 Tue, 19 Jan 2016 03:48:33 +0000 http://www.ritambhara.in/?p=2940#comment-2001 In reply to Clifford Kahn.

You are right. That’s a miss. It can however be changed that on the very first day the person will just set it off or don’t do anything if it is already off.
If you catch such things during the interview, then its a big plus.

]]>
By: Clifford Kahn https://demo.ritambhara.in/prisoners-and-the-lightbulb-puzzle/#comment-2000 Mon, 18 Jan 2016 17:54:02 +0000 http://www.ritambhara.in/?p=2940#comment-2000 What if the lightbulb is on at the outset? The problem statement doesn’t say that the lightbulb starts out off.
Suppose it is on at the outset. Suppose the counter is the first selected. Then by the algorithm, he/she could increment the count. But that would be incorrect, would it not?

]]>