this post was submitted on 25 Dec 2025
244 points (97.3% liked)

Programmer Humor

39640 readers
6 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 

Post:

You have three switches in one room and a single light bulb in another room. You are allowed to visit the room with the light bulb only once. How do you figure out which switch controls the bulb? Write your answer in the comments before looking at other answers.


Comment:

If this were an interview question, the correct response would be "Do you have any relevant questions for me? Because have a long list of things that more deserving of my precious time than to think about this!

you are viewing a single comment's thread
view the rest of the comments
[–] tias@discuss.tchncs.de 4 points 4 days ago (1 children)

This assumes that the light was off from the start but the question doesn't specify that.

[–] Dudewitbow@lemmy.zip 2 points 3 days ago (1 children)

if you want to avoid that problem, you would just add the step at the very start: have all the bulbs in off and wait a bit for all the bulbs to cool off if you needed to be sure.

[–] tias@discuss.tchncs.de 4 points 3 days ago (1 children)

wdym "have all the bulbs in off". You can't verify that without looking into the room and then you've burnt your one shot.

[–] Dudewitbow@lemmy.zip 0 points 3 days ago* (last edited 3 days ago) (1 children)

you get to the point where no question can ever be asaked to you because you believe in the manipulation of the question over to the point that you're intentionally looking for ways to break the question rather than assuming you and the question giver has the same assumption given the question circumstance.

If you go out and look for dumb things like that, there is basically no question in the universe thats answerable.

Do you question if gravity and friction exist if someone asks you how fast something is moving? and what values they are?

[–] Tlaloc_Temporal@lemmy.ca 1 points 3 days ago (1 children)

We can check that gravity and friction exists right now, without leaving the room. It's also quite specific situations that don't have either one.

Here, how the switches are related to the light is already in question, and dumb wiring jobs are more common than anyone wants.

[–] Dudewitbow@lemmy.zip 1 points 3 days ago* (last edited 3 days ago)

but you dont know the values to which they are to br able to ask a question involving it which is the point. youre put in a situation where you dont know everything. there are things you assume the question giver assumes else questions are never answerable. they arent given to you as a gotcha situation, especially in the context as a programming question.