this post was submitted on 25 Dec 2025
244 points (97.3% liked)
Programmer Humor
39640 readers
566 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
if anyoen is curous on the answer, you flip one and wait till you think a light bulb gets warm enough from ambient that youd notice. you then turn that off and turn another on.
if light = on, second switch you hit
if light = off && bulb = warm, it was the first switch
else switch 3
Doesn't say I can't leave the door open of the room with a light, or just put someone else in the room while I flick the switchs, use a few mirrors to bounce the light back to me,
of course, nothing says you can't but programming (and engineering) is not just solving the problem, but solving the problem efficiently.
one who lacks optimization knowledge would run into situations like the rockstar employee who originally wrote the parser for GTAO that made it take over 5 minutes to load GTAO, till someone else rewrote the parser in order to get people loaded in quicker. It's basically the weed out for the devs people complain about when something uses way more resources than it needs to.
I was confused why you had brought programming into it but I realised where I was lol I could always take the light out, can't waste resources on something that doesn't exist
That's not the answer. It's an answer. The question isn't very contained so there are a lot of answers. You can get someone else to switch the switches in order while you watch. Or you can install a camera in the room and then pull the switches. You can keep the door open to see which switches works, etc. Probably a million more solutions.
This assumes that the light was off from the start but the question doesn't specify that.
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.
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.
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?
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.
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.