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!
otacon239 @lemmy.world - 2day
For those that want the actual answer:
::: spoiler Tap for spoiler
You turn on the first switch for a minute or two, turn it off, and turn on the second switch. If the bulb is on, it’s obviously the second switch. If the bulb is off and warm, it’s the first switch. If it’s cold, it’s the third switch.
:::
188
NaibofTabr - 2day
This assumes several things to be true, which might not be true:
power is available/the upstream circuit is on (always a bad assumption to make)
the bulb is an incandescent type that will generate an appreciable amount of heat in a short amount of time
the bulb was in the off state before you changed the position of any switches, and has been off long enough to be cold
the bulb is connected to any of the switches
the bulb is connected to only one of the switches (parallel circuits are a thing, as are multi-switch lighting circuits)
If any of the above is not true, the conclusion is invalid.
235
partial_accumen - 2day
I'll go one further:
Assumes the bulb is in reach. When I read the problem I assumed the bulb was in a ceiling fixture out of reach. Nowhere in the text description did it specify the physical location, except "in the other room".
143
db2 @lemmy.world - 2day
Also the image shows all 3 switches are on.
21
SmoothLiquidation @lemmy.world - 2day
If I asked this question during an interview and the candidate gave me this list of assumptions, I would recommend the candidate. This is exactly what I would be looking for by asking a vague question, not if they memorized the answer to a bunch of riddles, but how they thought and what their line of thought was for troubleshooting the answer.
44
NaibofTabr - 2day
I tend to agree with this line of thinking. If you're trying to hire an effective problem solver, well the first step to solving any problem is understanding the problem - the whole problem - and often more importantly the context in which the problem exists.
And while my first reaction is to be frustrated with the person asking for a solution to such a vague problem... in the real world problems are rarely clearly stated, and frequently misstated. Investigating the apparent conditions of the problem is always necessary, and generally the fastest path to resolution.
18
taiyang @lemmy.world - 2day
I love the idea of someone trying this stupid question irl only to realize it wasn't even plugged in. That's ... well fuck, that's most IT work. The convoluted approach is definitely the wrong one. Lol
14
OpenStars - 1day
Also that the labels are as shown. For all we know the internal wiring is switched, and if that were the case then some could have Up=On while others have Up=Off but not all matching.
10
hikaru755 @lemmy.world - 1day
Also:
I still remember which switch is which after having checked the bulb
5
yaroto98 @lemmy.world - 2day
Text ambiguous. Leave doors(s) between rooms open. Flip switches, see which one controls bulb in other room. No need to even visit other room. Done in seconds.
88
Oka @sopuli.xyz - 2day
This also assumes youre alone, a practical person would send someone else in the other room and communicate the states back
56
harmbugler - 19hr
It doesn't assume you're alone.
1
Ricky Rigatoni - 11hr
Don't even need to leave the door open. What door doesn't have enough of a gap to see if a light is on?
2
Ilovethebomb @sh.itjust.works - 2day
You'd be boned if it's an LED bulb that doesn't warm up noticeably.
62
Nighed @feddit.uk - 2day
Or if it was turned on to begin with and you just turned it off
16
Pissmidget @lemmy.world - 2day
::: spoiler tap for comment to spoiler
Nice try, they recently upgraded to led lights.
:::
36
[deleted] - 2day
Assumes that the bulb can be touched, that it is hot when turned on, and that the position of the switch for 'on' is the standard position.
22
count_dongulus @lemmy.world - 2day
I really hate these awful "puzzles". They only work by the asker intentionally withholding what, if any, constraints exist in the problem space leaving it totally vague, but of course there ARE secret constraints revealed if you violate them with your answer.
Me: "I do it without flipping any switches. I just ask the lightswitches which one controls the light, and they tell me."
Interviewer: "That's not allowed."
Me: "Well what exactly is allowed? Can I pull the cables out of the wall and see which connects to the bulb? Oh, I bet that's not allowed. How about I open my smart home app and just check which of the smart switches is labeled for it? Oh, I bet it's not a smart switch so I can't do that either? Oh, then the bulb has a chime that boops when it comes on, so I just listen for the boop. Oh that's not allowed either? Wait wait wait, the walls are glass, so I just watch to see when the bulb comes on when I flick the switches."
Even the canonical answer makes a dumb assumption. Ordinary LED bulbs don't get hot.
144
4am @lemmy.zip - 2day
Their bases do, quite famously. Especially the smart ones.
21
18107 @aussie.zone - 2day
That is also assuming the lights are not recessed into the ceiling.
And the even more egregious assumption that you could even reach the lightbulb.
38
Dekkia - 2day
I fully agree with your rant.
But LED bulbs do get warm enough that this still would work.
17
drosophila - 2day
Philips Ultra Efficient bulbs use only 4 watts, and they have a glass bulb and metal base, so they might feel cool to the touch anyway. Or at least feel plausibly the same temperature as the room, depending on how hot it is in there.
22
Dekkia - 1day
I guess if you intentionally use a very efficent bulb you're right.
2
mnemonicmonkeys @sh.itjust.works - 2day
Even the canonical answer makes a dumb assumption. Ordinary LED bulbs don't get hot.
The problam originally came out before LED bulbs were a thing. At the time, you mainly could only get incandescent bulbs. That's not their fault
7
Natanael - 13hr
I can't believe not even a single person said "use a touchfree current detector".
At least I could argue back that's expected to be allowed if this circumstance happened IRL
1
hperrin @lemmy.ca - 2day
Ha! Easy! Go in the other room and take a picture of the bulb. Now go back to the switches and flip each one in order, while looking at the picture. When the picture of the bulb shows it lit up, that’s the switch.
95
kinkles @sh.itjust.works - 2day
Answer:
::: spoiler Tap for spoiler
Flip two switches and check the bulb.
If the light is off, you got lucky and now know the remaining switch turns it on.
If the light is on, you now know one switch that won’t turn it on. Return to the room and finger your asshole. You’re now having more fun than solving a logic puzzle.
:::
50
SkyezOpen @lemmy.world - 2day
Nah you gotta pick one switch, then they reveal a switch that does not turn the light on, then you get an opportunity to switch which one you picked and you should always switch.
23
Michal @programming.dev - 2day
And there i thought this was the Monty Hall problem
5
ilinamorato @lemmy.world - 1day
Ok. The classic answer is "turn on the first switch for five minutes. Then turn switch 1 back off, turn on the second switch and go in the room immediately. If the light is hot, it's controlled by switch 1; if it's on, it's controlled by switch 2; if it's off and cold it's controlled by switch 3."
Except that a light bulb in 2025 is very likely to be an LED bulb, so it wouldn't actually get hot. At least not hot enough to feel even a few moments later. And in a corporate setting (this is classically an interview question), the switch has been more likely to control a fluorescent tube, which can get hot, but typically not as quickly as an incandescent one.
My answer, if I were in an interview, would be to ask questions (Chesterton's Fence).
First of all, why do we have the one-visit limit? Is this a prod light bulb? We need a dev light bulb environment, with the bulbs and switches in the same room. (While we're making new environments, let's get a QA and regression environment, too. Maybe a fallback environment, depending on SLAs.)
Second, what might the other switches do? What's the downside to just turning them all on? If that's not known, why not? What is the risk? For that matter, do we know that only one switch needs to be turned on to turn on the light, or is it possible that the switches represent some sort of 3-bit binary encoding?
Third, why were the switches designed this way? Can they be redesigned to provide better feedback? Or simplified to a single switch? If not, better documentation (labeling) is a must.
Fourth, we need to reduce the length of the feedback loop. A five minute test and then physically going to touch the bulb is way too long. Let's look into moving the switches or the light in our dev environment so that the light can be seen from the switches.
40
Natanael - 13hr
"why was I not equipped with current detectors as that is standard practice in the industry?"
2
gustofwind @lemmy.world - 2day
The answer isn’t intuitive anymore now that lightbulbs don’t always get hot 🥲
39
Ledivin @lemmy.world - 2day
It wasn't intuitive before, either, without making an absolute ton of horrible assumptions.
Are the wires even connected?
Does only one switch control the light?
Did the light start on or off?
Is the light bulb in arm's reach?
Can I bring my friend and just yell to each other?
Can I just leave the door open and see whether it turns on or not?
It says I'm allowed to visit the bulb room once but never actually mentions the switch room - do I start there? Can I go back after visiting the bulb room?
And, as you said, what type of bulb is it?
Anyone who doesn't explore the assumptions should probably fail that particular interview question.
31
gustofwind @lemmy.world - 1day
I’ll be honest, a lot of those are pretty stupid
Obviously the wires are connected
Obviously one switch controls the light
Obviously the lights start off
In a thought experiment you can magically reach the lightbulb if you want
Obviously you cannot bring a friend
Obviously you cannot see the light from the switch
Obviously you return to the switches
1
Ledivin @lemmy.world - 1day
lol
Every time you say "obviously" to an assumption, someone else gets the job.
9
gustofwind @lemmy.world - 1day
If you’re hung up on the basic assumptions necessary to make the thought experiment work as clearly intended then you won’t get it neither
1
Ledivin @lemmy.world - 1day
Basic assumptions are why the Challenger exploded. Hopefully nobody ever hires you as an engineer.
3
stray @pawb.social - 2day
I don't understand. You don't need to visit a room to know whether the light is on in it.
36
Victor - 2day
This is the real answer. If there is a light switch that turns on a light in a room, rarely ever would you not see the results of switching it on from where the switch itself is located. Visiting the room is a red herring.
22
quinkin @lemmy.world - 19hr
Unlabelled switches controlling lights in another room isn't Workplace Health and Safety approved.
Lockout both rooms and log a job with maintenance.
33
fartographer @lemmy.world - 1day
"First, I would get a label maker and ask a coworker to assist me. Then, we'd work together to quickly figure out what each switch does, and then label them accordingly. In a business of this size and reputation, documenting your work and synergistic teamwork are foundational to value and growth."
Then, reject whatever offer they send and say that it's because they showed you a workplace culture that enabled middle management to test employees with busywork instead of minding their own business or solving their own damn trivial problems.
30
usernamefactory @lemmy.ca - 21hr
Go into the room and unscrew the bulb. You can now truthfully say that no switch affects the bulb’s condition, without messing with a bunch of switches whose function you don’t understand. You even know for a fact that the lack of bulb won’t cause a problem down the line, since the room is apparently no longer accessible.
22
NaibofTabr - 2day
Based on the provided information, there are some switches of unspecified type in one room and a light bulb of unspecified type in another room. There is no power source, nor do we know if there is even wiring between the switches and the bulb. For all we know, the switches and the bulb are still in their product packaging waiting to be installed by an electrician.
The bulb is not controlled by any of the switches in any meaningful manner.
Also, per the problem specification, I am allowed to visit the room with the light bulb only once. I am not allowed to visit the room with the switches, or operate the switches.
The comment in the original image is the most rational possible answer to such an exercise. Poorly stated problems are a waste of time.
*Edit: You know what, scratch all that, none of it really matters.
I'm not messing with an unknown electrical circuit without seeing the circuit diagram and verifying any relevant lockout/tagout. People die from that shit.
21
Cevilia (she/they/…) - 2day
Ok, what do we know. We know the bulb isn't screwed into anything. We also know the switches are in the "on" position but the bulb is not illuminated. From that, we can conclude that the switches do not control the bulb at all, or the bulb is somehow wirelessly controlled by the switches. We bring the bulb through and throw the switches one by one, see what happens.
21
MonkderVierte @lemmy.zip - 2day
This is either a really clever test of your problem solving and neccessary-information-extraction skills. Or a really dumb one with loads of asumptions and artifical restrictions and based on outdated data (comments hint to the lightbulb getting hot).
16
reddit_sux @lemmy.world - 16hr
Remove the switches put a microcontroller like esp32, connected via wifi to an app on your phone. Go to the other room and see which switch switches on the bulb.
If there is no wifi, why the hell do you want a programmer. I can't work without internet.
16
_druid @sh.itjust.works - 2day
Take the cover off, flip all three switches. Whichever terminal shocks you is completing the circuit for the light.
15
NaibofTabr - 2day
What if there are other things wired to those switches?
1
_druid @sh.itjust.works - 2day
I'll be sure to revisit this question, if I ever find myself retreating to square one, mired in my own ineptitude. For now, there are three unlicked terminals before me.
5
aarch64 @programming.dev - 2day
My burn-the-house-down take on this: very slowly flip each switch on and listen for arcing. Works fine assuming the other two switches aren't connected to anything.
15
Rose - 1day
I'll look through the door.
Or, set up a webcam to see when the light is on.
If this isn't allowed somehow, I'll tell the building management to consider rewiring this absolutely cursed light switch situation ASAP because it's gotten so bad that it's being used as a brainteaser by the recruiting department
15
SCmSTR - 22hr
This question becomes more a test of age as time goes. I've been asked this question even after the movement towards all-LEDs.
This question is also stupid, both because it has a correct question and because almost certainly some people have advantages over others that have nothing to do with the actual job.
20+ years ago? Sure, this was a somewhat viable question. But now? It's incredibly messy.
Over my years, I've asked dozens of very, very smart people from all kinds of walks of life, extremely smart to seemingly dumb as hell - nobody has ever gotten it right.
Probably the only thing this question is good for is seeing how an applicant does when faced with a diplomatic situation and a really dumb interviewer.
I'm super curious what the people who unironically ask this question think they're testing.
15
kryptonianCodeMonkey @lemmy.world - 19hr
It's a silly riddle that, for some reason, has stuck around in my head for decades, I think from an old tv show (anyone else remember Crashbox?). I remembered the answer immediately. So, this would be less of a test of my reasoning/problem solving skills, and more of a test of my ability to find and store vast amounts of useless trivia and instantly recall it decades after the fact. If that's what you're hiring for, I'm your guy!
11
MNByChoice @midwest.social - 1day
Building codes, at least the ones I am aware of, require the light switch inside the room with the light next to the door, similar to how nearly every room you have ever been in. (Everyone knows of exceptions.) This means either corners have been cut, at those switches should control things within the room with the switches.
As the interviewer if attention to detail and following build codes and specifications is important at this company. Is there a culture of safety, or are corners cut that put my life at risk.
14
sga - 1day
After reading the incandescent bulb solution, and problems regarding touching the bulb, i would switch first switch on for a appreciably long time, such that bulb has hit maximum luminousity (they heat up as they run, the hotter they get, the brighter they are), then turn switch off, and turn second switch on and quicky run to other room. we are trying to observe change in luminousity as time elapses. if it reduces, it was first (we ran it for a long time, there would be some residual glow, from my irl observations from when i was small suggest roughly 1 min period where i can still tell, but bulb wattage, contrat with background and distance matter). if increasing or max luminous, then second, if nothing then third.
but it was a stupid question. my naive guess was it can not be done, because with just 1 binary observation, you can not tell from 3 switches (you need atleast 2, which the solution assumes as temp and light state, i substitute heat with light state in transition). but still stupid. my natural assumption was leds, even when i head incandascent bulbs in my house somewhere for nearly half of my life. it is also stupid, because when you allow me to do something i was mentioned in question to do, i could just bend my way to do anything. like punch/drill through wall, or hack surveillance systems, or just pull out my handy multimeter that i always have on me, open switch box and see which switch is live, which is dead, or see voltage/current/wattage change across the loop, or measure resistance and guess what thing is there, or like blackmail the interviewer to extract the answer.
14
Pulptastic @midwest.social - 1day
You’re almost there. Turn the first one on for a while. Then then it off and turn the second one on and run to the room. There are theee possible scenarios. If the bulb is on, switch 2 controls it. If the bulb is hot but off switch 1 controls it. If the bulb is cold and off, switch 3 controls it.
6
sga - 1day
i know this solution, but many problems are there, what if it is in a ceiling fixture, or enclosed in something such that i can not know the temp (hot or cold), then i can still observe luminosity changes. if you feel your eyes do a bad job, get a camera properly color and temp caliberated, and just focus on filament (now auto exposure or temperature adjustment).
tl:dr i am still trying to poke holes in this thermocol wall of defence.
5
xthexder @l.sw0.com - 1day
If it's an LED or flourencent bulb they usually have a small amount of glow after turning them off from the phosphor coating. You might be able to catch that instead of the residual heat, but generally it dissipates pretty quickly, and it might be hard to see with one of the other lights on.
2
Tlaloc_Temporal - 1day
Worse, if the LED is wired to the hot side it will just barely glow at all times.
1
xthexder @l.sw0.com - 20hr
I think your house might be wired wrong if this is happening... The only thing I can think of is maybe if you've got some smart switch and no neutral, so the wifi in the switch has to power itself by leaking current through the light, which is a pretty unusual setup. I don't see how this could ever happen on a regular dumb switch.
1
Tlaloc_Temporal - 18hr
LEDs are so efficient that even microamps can power them. If your LED driver is cheap, it'll run on basically nothing, or charge up enough to start for a fraction of a second.
The microamps come from a hot wire running next to a switched wire behaving as a capacitor when carrying AC voltage, letting microamps leak through. (It's not required that the light is on the hot side of the switch as I said previously, my bad).
This can happen if the switch box is a terminal box with hot and switched wires in the same cable, which is rather common. Probably some other configurations too.
3
xthexder @l.sw0.com - 8hr
Well, I can't say I've ever seen it happen, but I could see how it could happen in certain scenarios, especially if the LED has some weird driver in it.
Maybe the capacitors in the driver would be allowed to charge up in some designs before getting dissipated through the LED in a flash?
The simplest form of LED light (just a rectifier and a bunch of LEDs in series for a 120V diode drop), idk if you'd ever see any glow or flashes, since LEDs don't turn on until a certain voltage, and if you're getting like 50V on an open circuit that seems to me like you've accidentally built a transformer in your walls.
1
Modern_medicine_isnt @lemmy.world - 1day
I would say, I do enjoy riddles, so this will be fun. But I am concerned that if you think my skill at riddles is critical, that it may mean your management has gotten used to not fully thinking through the objectives they give and how those objectives interact with the existing systems or other objectives. That would result in the kind of product that looks like the right hand doesn't know what the left is doing. If that is your reasoning for the question, how is the company countering it to create a coherent product.
And the reason I might say this is tgat in my experience, companies who ask such questions aren't the kind I want to work for.
14
Strlcpy@1 - 13hr
What bothers me about this specific question, apart from it being dated, is that it breaks the rules of these kind of riddles. They're implied to be in a sort of frictionless sphere universe, the whole preposition is silly except as an abstract puzzle. To then rely on the physical properties of real lamps is cheating. You're supposed to ignore all the real-world aspects of the setting except that one.
12
usernamefactory @lemmy.ca - 12hr
Agreed, it presents as an abstract logic puzzle, but then gives a very concrete answer. It’s like presenting the trolly problem to someone, and when they give one of the two expected answers saying “no, stupid, you run ahead and untie the victims before the trolly reaches them.”
It’s compounded by the fact that the proposed physical solution isn’t even very reliable, as lots of people in this thread have said. If we’re stepping outside of the logic puzzle constraints, why not just leave the door to the room open? Or have someone stand inside and shout when the light turns on? Or ask someone who knows these switches? Or any number of boring non-brain teaser solutions.
6
Wirlocke - 1day
Here's my answer that works with any kind of lightbulb.
Flip switch 1 on, switch 2 off, and get switch 3 stuck in a halfway point which I've done on both lever switches and flat switches.
If it's on it's switch 1, if it's off it's switch 2, if it's flickering or dimmed it's switch 3 and you should probably turn it off to stop damaging the relay.
11
xthexder @l.sw0.com - 1day
Trying to get a switch stuck half way sounds like a good way to start a fire. If the bulb is dimmed, that means not all the power is making it to the bulb, and half of it is probably going into heating up the switch contacts. It could also be arcing inside the switch, which will also destroy the contacts. I think some new building codes require "arc fault protection" on circuits for this type of reason, in addition to "ground fault protection" (GFCI) on bathroom/kitchen circuits.
9
fantacyde - 2day
Grab the bulb and bring into the room with you and replace it into a light fixture in your switch room. See which switch controls it. If this doesn't work, retrieve the bulb and answer with "currently none of the switches control it."
10
Jackie's Fridge - 1day
Literally ask someone which switch it is. Then ask them what idiot wired them up that way
9
bcovertigo - 1day
I'd walk into the other room first and drop a mirror in the hallway on my way back so I could see lmao. My employer wouldn't want me touching a hot bulb since that might be a workplace hazard they'd be liable for after training me with stupid riddles.
9
JackbyDev - 1day
Impossible even if you know if the light is on or off to start with. Even then, there are 2 possible outcomes which means the solution space halves on each test. 3 divided by 2 is greater than 1 (1.5) so we cannot figure it out in a single test.
That's my recollection of how to solve these from computer science. The classic one is 8 coins and figuring out which one weighs a different amount (and you don't know if it is more or less). You have a scale that tells you which side is heavier (or equal) but it doesn't give readouts (as in it doesn't say a side is X pounds/grams). With only three uses of the scale, how can you find the fake coin? I'm not going to go into the process in depth but because you have THREE outcomes (left heavier, equal, and right heavier) you reduce the solution space (which of the 8 coins is the bad one) by a THIRD each test. The number 8 sort of lures into thinking powers of 2. You can actually do it with 9 coins in 3 tests.
Some of the details of my explanation may be wrong, it's been over a decade since I took that class in college lol. It was my worst professor (while different story lol) but I distinctly remember him talking about this. He had a very thick accent, some form of eastern European or Russian, I'm not really sure what exactly. But he gave us that problem as homework or something or maybe just to think about. And he'd ask us to explain how we'd do it. Whenever someone began to describe something doing like test 4, 2, etc instead of the correct way (which involves using coins you already tested) he'd say "YOU'RE DOOMED!" Then someone else would try, and when they got to a way that wouldn't work "YOU'RE DOOMED!" It was hilarious. Very memorable.
7
chaos @beehaw.org - 1day
Hint: the solution depends on a more realistic and physics-based model of the problem than you're using. And, even bigger hint, it's less intuitive now that light bulb technology has changed to become much more efficient, you should imagine this problem taking place with a '90s bulb.
6
JackbyDev - 1day
Yeah, after reading the answers I see it more clearly. Also, I assume in hindsight that it's three switches which can be on or off, so we know if all three are off the light is off. Which helps as well.
3
Atlas_ @lemmy.world - 1day
Also the number of outcomes isn't connected to the solution space reduction the way you say. If you don't know whether the fake coin is heavier or lighter, both tilt-right and tilt-left are effectively the same result. So at least your first test really only has 2 meaningful outcomes.
In general, you'll only reduce your solution space DOWN TO (not by) 1/(number of distinguishable outcomes) if the possible solutions are evenly divided among those outcomes. It's easy to have a problem where "result 1 narrows it down a lot, result 2 doesn't tell us much"
5
JackbyDev - 1day
Like I said, it's been over a decade, some of the specifics may be lost to me.
2
Atlas_ @lemmy.world - 1day
If you don't know whether it's heavier or lighter, after the first test shows uneven you still have 6 coins possible. You can do it in 3 tests only if you know lighter vs heavier for the fake coin.
3
JackbyDev - 1day
YOU'RE DOOMED! You must weigh two against two in the first step.
1
workerONE @lemmy.world - 2day
You can get a 66% chance of being right if you turn on a switch and check the room. If the light is off you guess between the other two.
For example, you are going to test switch 1 and if it is off you guess switch 2.
Reminds me of the Monty Hall problem except in that problem the game show host has an action to take which effects the odds.
6
Bluewing @lemmy.world - 2day
If the installation of the circuit was done correctly in the first place, all 3 switches will turn the light on and off.
If they do not, there is a problem and it needs to be fixed. If you don't fix the issue, you have a major underlying problem in your company. And you are not worth my time.
5
TheSlad @sh.itjust.works - 1day
What is the purpose of having 3 switches next to eachother that all control the same light?
4
kopasz7 @sh.itjust.works - 1day
To fulfill the requirements.
5
TheSlad @sh.itjust.works - 1day
The requirements clearly state that only one switch controls the bulb
4
kopasz7 @sh.itjust.works - 1day
Must be an earlier revision. The PM just pinged me to add a fourth and fifth switch for "AI".
2
Bluewing @lemmy.world - 12hr
That's a question that the C-Suite needs to answer for. But the point is, if those switches are installed -for whatever reason- they do need to work correctly. And if they do not, that's an indication of a failing management.
2
rumba @lemmy.zip - 12hr
It depends on what type of person designed the circuit and what type of person you are.
Ergonomics: The switch closest to the door first, then mid, then far, figuring the unknown user would click the switch closest, a skilled electrician would start there. However, it's not unreasonable for the electrician to ask the owner, so this is a hit-or-miss approach.
Installation efficiency: The installer refused to mark any of the lines and instead hooked them up at random, flip in any order, when you find the right one, return the others to the original state.
time efficiency: the energy cost to flip all three switches is minimal and you're only going in once, flip all three at the same time. you've done maximum effort and maximum time savings.
Error reduction, binary counter, all combinations tested in case of chained switching
Debugging: binary counter, followed by checking the lightbulb, possibly swapping for another if one is nearby, checking all the other switches near the room, breakers, power to the structure, and asking an occupant for assistance as a last resort.
Disaster recovery: locate a flashlight or use your phone's torch/flashlight function.
Ahh crap, other room.
ask an occupant
shove a penny in the socket behind the light bulb and listen for a breaker to pop
turn all three on
slide your cell phone under the door with video recording on, stomp on the floor hard every time you flip a switch
turn all the switches through a binary counter looking for one that seems to do nothing.
3
Stupidmanager @lemmy.world - 53min
I’ve walked out of interviews that had these popular puzzle questions in the 00s. The company you’re interviewing for is not testing you for your job, it wants a corporate drone that is ok with bureaucracy and can navigate the red tape they’ve put in place.
Really a waste of time, but if I run into this at my age now I ask if they can tell me how their company is making something for the betterment of human kind.
3
kubica - 2day
Thinking skills, why would those be needed?
2
MonkderVierte @lemmy.zip - 2day
Disassemble the switch and look what's connected.
2
iThinkDifferentThanU @lemmy.world - 2day
turn them all on, problem solved
2
mlg @lemmy.world - 1hr
Knowing full well this would be coming from a FAANG company, a funnier answer would be to replace the switch with the equivalent smarthome switch, and then spend the next 20 minutes explaining their uttery stupid network pathway from your phone, through the cloud, back to your device to turn on a lightbulb.
cm0002 in programmer_humor @programming.dev
Op doesn't have time for interviews
For those that want the actual answer:
::: spoiler Tap for spoiler You turn on the first switch for a minute or two, turn it off, and turn on the second switch. If the bulb is on, it’s obviously the second switch. If the bulb is off and warm, it’s the first switch. If it’s cold, it’s the third switch. :::
This assumes several things to be true, which might not be true:
If any of the above is not true, the conclusion is invalid.
I'll go one further:
Also the image shows all 3 switches are on.
If I asked this question during an interview and the candidate gave me this list of assumptions, I would recommend the candidate. This is exactly what I would be looking for by asking a vague question, not if they memorized the answer to a bunch of riddles, but how they thought and what their line of thought was for troubleshooting the answer.
I tend to agree with this line of thinking. If you're trying to hire an effective problem solver, well the first step to solving any problem is understanding the problem - the whole problem - and often more importantly the context in which the problem exists.
And while my first reaction is to be frustrated with the person asking for a solution to such a vague problem... in the real world problems are rarely clearly stated, and frequently misstated. Investigating the apparent conditions of the problem is always necessary, and generally the fastest path to resolution.
I love the idea of someone trying this stupid question irl only to realize it wasn't even plugged in. That's ... well fuck, that's most IT work. The convoluted approach is definitely the wrong one. Lol
Also that the labels are as shown. For all we know the internal wiring is switched, and if that were the case then some could have Up=On while others have Up=Off but not all matching.
Also:
Text ambiguous. Leave doors(s) between rooms open. Flip switches, see which one controls bulb in other room. No need to even visit other room. Done in seconds.
This also assumes youre alone, a practical person would send someone else in the other room and communicate the states back
It doesn't assume you're alone.
Don't even need to leave the door open. What door doesn't have enough of a gap to see if a light is on?
You'd be boned if it's an LED bulb that doesn't warm up noticeably.
Or if it was turned on to begin with and you just turned it off
::: spoiler tap for comment to spoiler Nice try, they recently upgraded to led lights. :::
Assumes that the bulb can be touched, that it is hot when turned on, and that the position of the switch for 'on' is the standard position.
I really hate these awful "puzzles". They only work by the asker intentionally withholding what, if any, constraints exist in the problem space leaving it totally vague, but of course there ARE secret constraints revealed if you violate them with your answer.
Me: "I do it without flipping any switches. I just ask the lightswitches which one controls the light, and they tell me."
Interviewer: "That's not allowed."
Me: "Well what exactly is allowed? Can I pull the cables out of the wall and see which connects to the bulb? Oh, I bet that's not allowed. How about I open my smart home app and just check which of the smart switches is labeled for it? Oh, I bet it's not a smart switch so I can't do that either? Oh, then the bulb has a chime that boops when it comes on, so I just listen for the boop. Oh that's not allowed either? Wait wait wait, the walls are glass, so I just watch to see when the bulb comes on when I flick the switches."
Even the canonical answer makes a dumb assumption. Ordinary LED bulbs don't get hot.
Their bases do, quite famously. Especially the smart ones.
That is also assuming the lights are not recessed into the ceiling.
And the even more egregious assumption that you could even reach the lightbulb.
I fully agree with your rant.
But LED bulbs do get warm enough that this still would work.
Philips Ultra Efficient bulbs use only 4 watts, and they have a glass bulb and metal base, so they might feel cool to the touch anyway. Or at least feel plausibly the same temperature as the room, depending on how hot it is in there.
I guess if you intentionally use a very efficent bulb you're right.
The problam originally came out before LED bulbs were a thing. At the time, you mainly could only get incandescent bulbs. That's not their fault
I can't believe not even a single person said "use a touchfree current detector".
At least I could argue back that's expected to be allowed if this circumstance happened IRL
Ha! Easy! Go in the other room and take a picture of the bulb. Now go back to the switches and flip each one in order, while looking at the picture. When the picture of the bulb shows it lit up, that’s the switch.
Answer:
::: spoiler Tap for spoiler Flip two switches and check the bulb. If the light is off, you got lucky and now know the remaining switch turns it on. If the light is on, you now know one switch that won’t turn it on. Return to the room and finger your asshole. You’re now having more fun than solving a logic puzzle. :::
Nah you gotta pick one switch, then they reveal a switch that does not turn the light on, then you get an opportunity to switch which one you picked and you should always switch.
And there i thought this was the Monty Hall problem
Ok. The classic answer is "turn on the first switch for five minutes. Then turn switch 1 back off, turn on the second switch and go in the room immediately. If the light is hot, it's controlled by switch 1; if it's on, it's controlled by switch 2; if it's off and cold it's controlled by switch 3."
Except that a light bulb in 2025 is very likely to be an LED bulb, so it wouldn't actually get hot. At least not hot enough to feel even a few moments later. And in a corporate setting (this is classically an interview question), the switch has been more likely to control a fluorescent tube, which can get hot, but typically not as quickly as an incandescent one.
My answer, if I were in an interview, would be to ask questions (Chesterton's Fence).
First of all, why do we have the one-visit limit? Is this a prod light bulb? We need a dev light bulb environment, with the bulbs and switches in the same room. (While we're making new environments, let's get a QA and regression environment, too. Maybe a fallback environment, depending on SLAs.)
Second, what might the other switches do? What's the downside to just turning them all on? If that's not known, why not? What is the risk? For that matter, do we know that only one switch needs to be turned on to turn on the light, or is it possible that the switches represent some sort of 3-bit binary encoding?
Third, why were the switches designed this way? Can they be redesigned to provide better feedback? Or simplified to a single switch? If not, better documentation (labeling) is a must.
Fourth, we need to reduce the length of the feedback loop. A five minute test and then physically going to touch the bulb is way too long. Let's look into moving the switches or the light in our dev environment so that the light can be seen from the switches.
"why was I not equipped with current detectors as that is standard practice in the industry?"
The answer isn’t intuitive anymore now that lightbulbs don’t always get hot 🥲
It wasn't intuitive before, either, without making an absolute ton of horrible assumptions.
Anyone who doesn't explore the assumptions should probably fail that particular interview question.
I’ll be honest, a lot of those are pretty stupid
Obviously the wires are connected
Obviously one switch controls the light
Obviously the lights start off
In a thought experiment you can magically reach the lightbulb if you want
Obviously you cannot bring a friend
Obviously you cannot see the light from the switch
Obviously you return to the switches
lol
Every time you say "obviously" to an assumption, someone else gets the job.
If you’re hung up on the basic assumptions necessary to make the thought experiment work as clearly intended then you won’t get it neither
Basic assumptions are why the Challenger exploded. Hopefully nobody ever hires you as an engineer.
I don't understand. You don't need to visit a room to know whether the light is on in it.
This is the real answer. If there is a light switch that turns on a light in a room, rarely ever would you not see the results of switching it on from where the switch itself is located. Visiting the room is a red herring.
Unlabelled switches controlling lights in another room isn't Workplace Health and Safety approved.
Lockout both rooms and log a job with maintenance.
"First, I would get a label maker and ask a coworker to assist me. Then, we'd work together to quickly figure out what each switch does, and then label them accordingly. In a business of this size and reputation, documenting your work and synergistic teamwork are foundational to value and growth."
Then, reject whatever offer they send and say that it's because they showed you a workplace culture that enabled middle management to test employees with busywork instead of minding their own business or solving their own damn trivial problems.
Go into the room and unscrew the bulb. You can now truthfully say that no switch affects the bulb’s condition, without messing with a bunch of switches whose function you don’t understand. You even know for a fact that the lack of bulb won’t cause a problem down the line, since the room is apparently no longer accessible.
Based on the provided information, there are some switches of unspecified type in one room and a light bulb of unspecified type in another room. There is no power source, nor do we know if there is even wiring between the switches and the bulb. For all we know, the switches and the bulb are still in their product packaging waiting to be installed by an electrician.The bulb is not controlled by any of the switches in any meaningful manner.Also, per the problem specification, I am allowed to visit the room with the light bulb only once. I am not allowed to visit the room with the switches, or operate the switches.The comment in the original image is the most rational possible answer to such an exercise. Poorly stated problems are a waste of time.*Edit: You know what, scratch all that, none of it really matters.
I'm not messing with an unknown electrical circuit without seeing the circuit diagram and verifying any relevant lockout/tagout. People die from that shit.
Ok, what do we know. We know the bulb isn't screwed into anything. We also know the switches are in the "on" position but the bulb is not illuminated. From that, we can conclude that the switches do not control the bulb at all, or the bulb is somehow wirelessly controlled by the switches. We bring the bulb through and throw the switches one by one, see what happens.
This is either a really clever test of your problem solving and neccessary-information-extraction skills. Or a really dumb one with loads of asumptions and artifical restrictions and based on outdated data (comments hint to the lightbulb getting hot).
Remove the switches put a microcontroller like esp32, connected via wifi to an app on your phone. Go to the other room and see which switch switches on the bulb.
If there is no wifi, why the hell do you want a programmer. I can't work without internet.
Take the cover off, flip all three switches. Whichever terminal shocks you is completing the circuit for the light.
What if there are other things wired to those switches?
I'll be sure to revisit this question, if I ever find myself retreating to square one, mired in my own ineptitude. For now, there are three unlicked terminals before me.
My burn-the-house-down take on this: very slowly flip each switch on and listen for arcing. Works fine assuming the other two switches aren't connected to anything.
I'll look through the door.
Or, set up a webcam to see when the light is on.
If this isn't allowed somehow, I'll tell the building management to consider rewiring this absolutely cursed light switch situation ASAP because it's gotten so bad that it's being used as a brainteaser by the recruiting department
This question becomes more a test of age as time goes. I've been asked this question even after the movement towards all-LEDs.
This question is also stupid, both because it has a correct question and because almost certainly some people have advantages over others that have nothing to do with the actual job.
20+ years ago? Sure, this was a somewhat viable question. But now? It's incredibly messy.
Over my years, I've asked dozens of very, very smart people from all kinds of walks of life, extremely smart to seemingly dumb as hell - nobody has ever gotten it right.
Probably the only thing this question is good for is seeing how an applicant does when faced with a diplomatic situation and a really dumb interviewer.
I'm super curious what the people who unironically ask this question think they're testing.
It's a silly riddle that, for some reason, has stuck around in my head for decades, I think from an old tv show (anyone else remember Crashbox?). I remembered the answer immediately. So, this would be less of a test of my reasoning/problem solving skills, and more of a test of my ability to find and store vast amounts of useless trivia and instantly recall it decades after the fact. If that's what you're hiring for, I'm your guy!
Building codes, at least the ones I am aware of, require the light switch inside the room with the light next to the door, similar to how nearly every room you have ever been in. (Everyone knows of exceptions.) This means either corners have been cut, at those switches should control things within the room with the switches.
As the interviewer if attention to detail and following build codes and specifications is important at this company. Is there a culture of safety, or are corners cut that put my life at risk.
After reading the incandescent bulb solution, and problems regarding touching the bulb, i would switch first switch on for a appreciably long time, such that bulb has hit maximum luminousity (they heat up as they run, the hotter they get, the brighter they are), then turn switch off, and turn second switch on and quicky run to other room. we are trying to observe change in luminousity as time elapses. if it reduces, it was first (we ran it for a long time, there would be some residual glow, from my irl observations from when i was small suggest roughly 1 min period where i can still tell, but bulb wattage, contrat with background and distance matter). if increasing or max luminous, then second, if nothing then third.
but it was a stupid question. my naive guess was it can not be done, because with just 1 binary observation, you can not tell from 3 switches (you need atleast 2, which the solution assumes as temp and light state, i substitute heat with light state in transition). but still stupid. my natural assumption was leds, even when i head incandascent bulbs in my house somewhere for nearly half of my life. it is also stupid, because when you allow me to do something i was mentioned in question to do, i could just bend my way to do anything. like punch/drill through wall, or hack surveillance systems, or just pull out my handy multimeter that i always have on me, open switch box and see which switch is live, which is dead, or see voltage/current/wattage change across the loop, or measure resistance and guess what thing is there, or like blackmail the interviewer to extract the answer.
You’re almost there. Turn the first one on for a while. Then then it off and turn the second one on and run to the room. There are theee possible scenarios. If the bulb is on, switch 2 controls it. If the bulb is hot but off switch 1 controls it. If the bulb is cold and off, switch 3 controls it.
i know this solution, but many problems are there, what if it is in a ceiling fixture, or enclosed in something such that i can not know the temp (hot or cold), then i can still observe luminosity changes. if you feel your eyes do a bad job, get a camera properly color and temp caliberated, and just focus on filament (now auto exposure or temperature adjustment).
tl:dr i am still trying to poke holes in this thermocol wall of defence.
If it's an LED or flourencent bulb they usually have a small amount of glow after turning them off from the phosphor coating. You might be able to catch that instead of the residual heat, but generally it dissipates pretty quickly, and it might be hard to see with one of the other lights on.
Worse, if the LED is wired to the hot side it will just barely glow at all times.
I think your house might be wired wrong if this is happening... The only thing I can think of is maybe if you've got some smart switch and no neutral, so the wifi in the switch has to power itself by leaking current through the light, which is a pretty unusual setup. I don't see how this could ever happen on a regular dumb switch.
LEDs are so efficient that even microamps can power them. If your LED driver is cheap, it'll run on basically nothing, or charge up enough to start for a fraction of a second.
The microamps come from a hot wire running next to a switched wire behaving as a capacitor when carrying AC voltage, letting microamps leak through. (It's not required that the light is on the hot side of the switch as I said previously, my bad).
This can happen if the switch box is a terminal box with hot and switched wires in the same cable, which is rather common. Probably some other configurations too.
Well, I can't say I've ever seen it happen, but I could see how it could happen in certain scenarios, especially if the LED has some weird driver in it. Maybe the capacitors in the driver would be allowed to charge up in some designs before getting dissipated through the LED in a flash?
The simplest form of LED light (just a rectifier and a bunch of LEDs in series for a 120V diode drop), idk if you'd ever see any glow or flashes, since LEDs don't turn on until a certain voltage, and if you're getting like 50V on an open circuit that seems to me like you've accidentally built a transformer in your walls.
I would say, I do enjoy riddles, so this will be fun. But I am concerned that if you think my skill at riddles is critical, that it may mean your management has gotten used to not fully thinking through the objectives they give and how those objectives interact with the existing systems or other objectives. That would result in the kind of product that looks like the right hand doesn't know what the left is doing. If that is your reasoning for the question, how is the company countering it to create a coherent product.
And the reason I might say this is tgat in my experience, companies who ask such questions aren't the kind I want to work for.
What bothers me about this specific question, apart from it being dated, is that it breaks the rules of these kind of riddles. They're implied to be in a sort of frictionless sphere universe, the whole preposition is silly except as an abstract puzzle. To then rely on the physical properties of real lamps is cheating. You're supposed to ignore all the real-world aspects of the setting except that one.
Agreed, it presents as an abstract logic puzzle, but then gives a very concrete answer. It’s like presenting the trolly problem to someone, and when they give one of the two expected answers saying “no, stupid, you run ahead and untie the victims before the trolly reaches them.”
It’s compounded by the fact that the proposed physical solution isn’t even very reliable, as lots of people in this thread have said. If we’re stepping outside of the logic puzzle constraints, why not just leave the door to the room open? Or have someone stand inside and shout when the light turns on? Or ask someone who knows these switches? Or any number of boring non-brain teaser solutions.
Here's my answer that works with any kind of lightbulb.
Flip switch 1 on, switch 2 off, and get switch 3 stuck in a halfway point which I've done on both lever switches and flat switches.
If it's on it's switch 1, if it's off it's switch 2, if it's flickering or dimmed it's switch 3 and you should probably turn it off to stop damaging the relay.
Trying to get a switch stuck half way sounds like a good way to start a fire. If the bulb is dimmed, that means not all the power is making it to the bulb, and half of it is probably going into heating up the switch contacts. It could also be arcing inside the switch, which will also destroy the contacts. I think some new building codes require "arc fault protection" on circuits for this type of reason, in addition to "ground fault protection" (GFCI) on bathroom/kitchen circuits.
Grab the bulb and bring into the room with you and replace it into a light fixture in your switch room. See which switch controls it. If this doesn't work, retrieve the bulb and answer with "currently none of the switches control it."
Literally ask someone which switch it is. Then ask them what idiot wired them up that way
I'd walk into the other room first and drop a mirror in the hallway on my way back so I could see lmao. My employer wouldn't want me touching a hot bulb since that might be a workplace hazard they'd be liable for after training me with stupid riddles.
Impossible even if you know if the light is on or off to start with. Even then, there are 2 possible outcomes which means the solution space halves on each test. 3 divided by 2 is greater than 1 (1.5) so we cannot figure it out in a single test.
That's my recollection of how to solve these from computer science. The classic one is 8 coins and figuring out which one weighs a different amount (and you don't know if it is more or less). You have a scale that tells you which side is heavier (or equal) but it doesn't give readouts (as in it doesn't say a side is X pounds/grams). With only three uses of the scale, how can you find the fake coin? I'm not going to go into the process in depth but because you have THREE outcomes (left heavier, equal, and right heavier) you reduce the solution space (which of the 8 coins is the bad one) by a THIRD each test. The number 8 sort of lures into thinking powers of 2. You can actually do it with 9 coins in 3 tests.
Some of the details of my explanation may be wrong, it's been over a decade since I took that class in college lol. It was my worst professor (while different story lol) but I distinctly remember him talking about this. He had a very thick accent, some form of eastern European or Russian, I'm not really sure what exactly. But he gave us that problem as homework or something or maybe just to think about. And he'd ask us to explain how we'd do it. Whenever someone began to describe something doing like test 4, 2, etc instead of the correct way (which involves using coins you already tested) he'd say "YOU'RE DOOMED!" Then someone else would try, and when they got to a way that wouldn't work "YOU'RE DOOMED!" It was hilarious. Very memorable.
Hint: the solution depends on a more realistic and physics-based model of the problem than you're using. And, even bigger hint, it's less intuitive now that light bulb technology has changed to become much more efficient, you should imagine this problem taking place with a '90s bulb.
Yeah, after reading the answers I see it more clearly. Also, I assume in hindsight that it's three switches which can be on or off, so we know if all three are off the light is off. Which helps as well.
Also the number of outcomes isn't connected to the solution space reduction the way you say. If you don't know whether the fake coin is heavier or lighter, both tilt-right and tilt-left are effectively the same result. So at least your first test really only has 2 meaningful outcomes.
In general, you'll only reduce your solution space DOWN TO (not by) 1/(number of distinguishable outcomes) if the possible solutions are evenly divided among those outcomes. It's easy to have a problem where "result 1 narrows it down a lot, result 2 doesn't tell us much"
Like I said, it's been over a decade, some of the specifics may be lost to me.
If you don't know whether it's heavier or lighter, after the first test shows uneven you still have 6 coins possible. You can do it in 3 tests only if you know lighter vs heavier for the fake coin.
YOU'RE DOOMED! You must weigh two against two in the first step.
You can get a 66% chance of being right if you turn on a switch and check the room. If the light is off you guess between the other two. For example, you are going to test switch 1 and if it is off you guess switch 2.
Reminds me of the Monty Hall problem except in that problem the game show host has an action to take which effects the odds.
If the installation of the circuit was done correctly in the first place, all 3 switches will turn the light on and off.
If they do not, there is a problem and it needs to be fixed. If you don't fix the issue, you have a major underlying problem in your company. And you are not worth my time.
What is the purpose of having 3 switches next to eachother that all control the same light?
To fulfill the requirements.
The requirements clearly state that only one switch controls the bulb
Must be an earlier revision. The PM just pinged me to add a fourth and fifth switch for "AI".
That's a question that the C-Suite needs to answer for. But the point is, if those switches are installed -for whatever reason- they do need to work correctly. And if they do not, that's an indication of a failing management.
It depends on what type of person designed the circuit and what type of person you are.
Ergonomics: The switch closest to the door first, then mid, then far, figuring the unknown user would click the switch closest, a skilled electrician would start there. However, it's not unreasonable for the electrician to ask the owner, so this is a hit-or-miss approach.
Installation efficiency: The installer refused to mark any of the lines and instead hooked them up at random, flip in any order, when you find the right one, return the others to the original state.
time efficiency: the energy cost to flip all three switches is minimal and you're only going in once, flip all three at the same time. you've done maximum effort and maximum time savings.
Error reduction, binary counter, all combinations tested in case of chained switching
Debugging: binary counter, followed by checking the lightbulb, possibly swapping for another if one is nearby, checking all the other switches near the room, breakers, power to the structure, and asking an occupant for assistance as a last resort.
Disaster recovery: locate a flashlight or use your phone's torch/flashlight function.
Ahh crap, other room.
ask an occupant
shove a penny in the socket behind the light bulb and listen for a breaker to pop
turn all three on
slide your cell phone under the door with video recording on, stomp on the floor hard every time you flip a switch
turn all the switches through a binary counter looking for one that seems to do nothing.
I’ve walked out of interviews that had these popular puzzle questions in the 00s. The company you’re interviewing for is not testing you for your job, it wants a corporate drone that is ok with bureaucracy and can navigate the red tape they’ve put in place.
Really a waste of time, but if I run into this at my age now I ask if they can tell me how their company is making something for the betterment of human kind.
Thinking skills, why would those be needed?
Disassemble the switch and look what's connected.
turn them all on, problem solved
Knowing full well this would be coming from a FAANG company, a funnier answer would be to replace the switch with the equivalent smarthome switch, and then spend the next 20 minutes explaining their uttery stupid network pathway from your phone, through the cloud, back to your device to turn on a lightbulb.