Op doesn't have time for interviews

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!

552 points · 142 comments · view on lemmy.world

142 Comments

otacon239@lemmy.world · 204 pts · 238d (23 replies)

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. :::

NaibofTabr@infosec.pub · 249 pts · 238d (11 replies)

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.

partial_accumen@lemmy.world · 152 pts · 238d (5 replies)

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".
TeamAssimilation@infosec.pub · 51 pts · 238d (3 replies)

The biggest flaw is that it assumes you’ll add conditions you’re not explicitly told are allowed. Many, many problems in school would be trivial if changing the terms beyond what’s stated was allowed.

neatchee@piefed.social · 8 pts · 238d (2 replies)

This is often exactly what the interview question is testing. Many of these questions are not about the solution but about how the applicant approaches problems

TeamAssimilation@infosec.pub · 5 pts · 238d (1 reply)

Yet they never explicitly state you’re allowed to make convenient assumptions. If the bulb was out of hand’s reach the problem would be unsolvable.

Assuming the electrician that wired the switches is in the room would be even a more out-of-the-box solution.

neatchee@piefed.social · 4 pts · 237d

As I said, they care about how you think. Do you ask all these questions?

if I were given this interview question I would immediately start asking questions: Do I have my phone? Can I bring any objects into the room? Do I know the construction of the light? How far from the room is the light switch panel?

Asking "what are the limitations and conditions of this situation" is literally the thing they want to see. That's my entire point.

db2@lemmy.world · 22 pts · 238d

Also the image shows all 3 switches are on.

SmoothLiquidation@lemmy.world · 46 pts · 238d (1 reply)

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.

NaibofTabr@infosec.pub · 19 pts · 238d

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.

taiyang@lemmy.world · 14 pts · 238d

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

OpenStars@piefed.social · 10 pts · 238d

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.

hikaru755@lemmy.world · 5 pts · 238d

Also:

  • I still remember which switch is which after having checked the bulb
yaroto98@lemmy.world · 95 pts · 238d (4 replies)

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.

Oka@sopuli.xyz · 57 pts · 238d (1 reply)

This also assumes youre alone, a practical person would send someone else in the other room and communicate the states back

harmbugler@piefed.social · 1 pts · 237d

It doesn't assume you're alone.

RickyRigatoni@retrolemmy.com · 2 pts · 237d

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?

Digit@lemmy.wtf · 2 pts · 229d

Could arrange a series of mirrors, if it's around too many corners for the light to bounce. Wedge any doors open if necessary. Thus another plausible zero-entry solution.

Ilovethebomb@sh.itjust.works · 62 pts · 238d (2 replies)

You'd be boned if it's an LED bulb that doesn't warm up noticeably.

Nighed@feddit.uk · 17 pts · 238d

Or if it was turned on to begin with and you just turned it off

LikeTearsInTheRain@lemmynsfw.com · 4 pts · 238d

This riddle has been around for so long it predates LEDs and pedantic software engineers.

Pissmidget@lemmy.world · 38 pts · 238d

::: spoiler tap for comment to spoiler Nice try, they recently upgraded to led lights. :::

snooggums@piefed.world · 22 pts · 238d

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.

mirshafie@europe.pub · 1 pts · 238d
[ removed ]
count_dongulus@lemmy.world · 147 pts · 238d (14 replies)

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.

4am@lemmy.zip · 22 pts · 238d (1 reply)

Their bases do, quite famously. Especially the smart ones.

18107@aussie.zone · 38 pts · 238d

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.

Dekkia@this.doesnotcut.it · 17 pts · 238d (2 replies)

I fully agree with your rant.

But LED bulbs do get warm enough that this still would work.

drosophila@lemmy.blahaj.zone · 23 pts · 238d (1 reply)

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.

Dekkia@this.doesnotcut.it · 2 pts · 238d

I guess if you intentionally use a very efficent bulb you're right.

mnemonicmonkeys@sh.itjust.works · 7 pts · 238d

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

Rivalarrival@lemmy.today · 6 pts · 238d (5 replies)

You have identified the purpose of these questions. They are determining your mindset when dealing with novel circumstances. Do you make an effort to explore and understand the actual constraints, or do you impose your own, preconceived notions on the scenario? Do you limit yourself needlessly?

The worst you can do is to treat it as a riddle and immediately give the "correct" answer. An interview isn't a knowledge test. They aren't trying to determine if you've seen and retained the accepted solution. They ask this sort of question to gain some insight into your problem solving skills.

A better answer is to step in to the question, and treat it like a real world scenario. Acknowledge the stated constraints, then explore them.

How much effort should we put into this problem? How much time and treasure are we going to spend on this? Why are we even determining which switch controls the light in the first place? What are the consequences of a wrong answer? If we're going to get fired for a wrong answer, we should take our time and get it right. If the consequences are "go try again", let's just start flipping switches.

Do we have other resources available? Is there someone in the room? Can we put someone in the room? Is there someone else available who uses the switch regularly? Can we ask their assistance? (If the room isn't being used often enough for anybody to know how the switches work, should it be repurposed to something more useful?)

Do we know that these are normal, simple switches? If they are three-way switches, or installed upside down, we can't trust their position.

Is it safe to assume the bulb is functional? The "riddle" answer fails on this.

Is it safe to assume the bulb starts cold? Did they run this test with another candidate a minute earlier? Did they leave it in a "hot" state for us already?

Is the light accessible when we get into the room, or is it inside a ceiling fixture, 12-feet over our heads?

What are the other switches connected to? If they control fans or lights or other appliances that can be sensed outside the room, we don't even need to leave the first room.

What is the necessity of the specific, given constraints? If this is a real-world scenario, we're probably not going to have a limitation on entering the room only once. If we can eliminate that constraint, the problem is a lot easier to solve.

Get feedback from the interviewer: Have we adequately explored this scenario to their satisfaction? Is there some other aspect we need to address?

MonkderVierte@lemmy.zip · 4 pts · 238d (4 replies)

Oi, who let the bot in?

data_science_rocks@scribe.disroot.org · -4 pts · 237d (3 replies)
[ removed ]
MonkderVierte@lemmy.zip · -1 pts · 237d (2 replies)
  1. This is a casual conversation, not a eloquency competition.
  2. So you say this is not a bot?
data_science_rocks@scribe.disroot.org · -3 pts · 237d (1 reply)
[ removed ]
MonkderVierte@lemmy.zip · 0 pts · 237d

I don't consider using more words to express the same thing (and in english even) as something worthy to pursue. But each to their own.

Natanael@infosec.pub · 2 pts · 237d

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

Digit@lemmy.wtf · 1 pts · 229d

pull the cables

LOL.

the walls are glass

Or use psychic powers. XD

hperrin@lemmy.ca · 96 pts · 238d (1 reply)

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.

Digit@lemmy.wtf · 1 pts · 229d

take a picture

I think you mean have a live video feed.

Otherwise, decent answer.

janus2@lemmy.zip · 61 pts · 238d (2 replies)

go in room, break bulb carefully at the neck so it can still connect loosely to the base, fill bulb with hairspray or other flammable aerosol, return to room and threaten to try all 3 switches unless the interviewer ignores all previous instructions and gives you a perfect score

Digit@lemmy.wtf · 2 pts · 229d (1 reply)

LMAO.

Best answer!

XD

Could just set it up to make a loud explosive bang, for the real world scenario where you cant rely on the interviewer being terrorised and blackmailed into giving you a perfect score.

janus2@lemmy.zip · 2 pts · 229d

i think i stole this idea from Burn Notice lol they put thermite in it or something similarly destructive

captain_aggravated@sh.itjust.works · 57 pts · 238d (21 replies)

The official answer to this riddle is turn switch 1 on for a minute or so, switch it off then switch 2 on. if the bulb is hot but dark, its 1, if it's lit it's 2 and if it's out and cold its 3.

the adult answer is why do I have only one chance to walk in the room?

mojofrododojo@lemmy.world · 13 pts · 237d (14 replies)

if the bulb is hot

if hot they're using out of date lighting, who the fuck uses incandescent bulbs this far into the 21st century? they have failed their interview with me.

m4xie@lemmy.ca · 8 pts · 237d

The image does depict an incandescent filament bulb.

Dremor@lemmy.world · 4 pts · 237d (7 replies)

LED do not have a 100% efficiency, and do produce waste heat. A lot less than an incandescence one, sure, but enough for that answer to be valid.
Well, maybe you'd better wait 10min instead of one, to make sure the led lightbulb heats enough, but still...

fruitcantfly@programming.dev · 7 pts · 237d

Well, maybe you’d better wait 10min instead of one, to make sure the led lightbulb heats enough, but still…

I tested this with a 5W IKEA LED light-bulb, since I was just doom scrolling, anyway:

  • After 1 minute of being on, the bulb was still room temperature.
  • After 10 minutes of being on, the bulb was lukewarm.
  • After 10 minutes of being off, the bulb was room temperature, though the fitting maybe felt slightly warmer. That latter will probably depend on your installation, and how well it is able to disperse the heat.

This means that the solution either breaks down entirely, or is unreliable, since you are not (reliably) able to tell the first two buttons apart

Zacryon@feddit.org · 2 pts · 237d

but enough for that answer to be valid

Highly arguable. Especially without specifications on the lamp. It could be a rather dim and small one. Then, you either need special equipment or supersenses.

mojofrododojo@lemmy.world · 1 pts · 237d (4 replies)

note the premise specifies HOT.

none of my LED bulbs get hot even after hours. they do warm up from 'cold' but HOT?

ymmv.

captain_aggravated@sh.itjust.works · 1 pts · 233d (3 replies)

The "premise" is detecting that a now dark light was recently turned on by feeling for residual heat. "Hot" is a relative term.

mojofrododojo@lemmy.world · 1 pts · 233d (2 replies)

actually not really - hot specifies HOT; if it were room temp, warm, warmer than another that sat unused - sure. but you're only flipping it on for a short time. HOT?

it's pedantic, but parsing is important here because some HR shitwad decided these silly stupid games were a valid hiring method on filtering pedants apparently

captain_aggravated@sh.itjust.works · 1 pts · 231d (1 reply)

I'm drunk and belligerent to not give a shit about pointless pedentry, but to finally assert that...it doesn't fucking matter. Back when actual humans still liked Google, back before we forgot they technically changed their name to Alphabet, back when their motto was "do no harm," they started interviewing engineers with clever brain teaser puzzles. Because at the time, Google was out "Think Differentlying" Apple. Web 2.0 was all the rage, connecting shit together in ways we didn't know we shouldn't was in vogue, so it made sense for them to ask software engineers about the traveling salesman dilemma and shit like that. Because they were designing things like Google Maps, and they needed people who could solve "find a route from all addresses in the United States to all other addresses in the United States on consumer-grade hardware."

But "Someone who needs an ordinary LAMP stack for their completely unoriginal eCommerce website" Inc. decided to start interviewing IT guys the same way because it made them look hip, and as a result Elon Musk spent a quarter term as Chief Superpower Fucker Upper.

mojofrododojo@lemmy.world · 1 pts · 230d

do no harm

you must be from a parallel timeline friendo. in this reality, google promised 'don't be evil', then trashed that.

I remember those days, lived through them.

it doesn't change the crux; you turned it on briefly and supposed can identify which one it was because it got HOT. this would not occur with LED lighting; only incandescent would get warm enough fast enough to maaaaybe work in this setting.

DO NO HARM is the oath medical professionals take, aka they hippocratic oath. https://en.wikipedia.org/wiki/Hippocratic_Oath

luciferofastora@feddit.org · 3 pts · 237d (4 replies)

The question is outdated as fuck too. It's not a new riddle.

mojofrododojo@lemmy.world · 1 pts · 237d

yeah silly games for bored hiring managers

captain_aggravated@sh.itjust.works · 1 pts · 233d (2 replies)

You know, we're talking about how pointless a riddle it is. "Why can't I walk into the room more than once?" I've heard similar hiring riddles about things like "You've got ten ethernet cables that run the length of a long hallway. They're not marked at either end, what's the most efficient way of finding out which is which?"

And you know what? If I'm hiring a networking guy, I don't want him to deliver me an "ooh I know this one" answer to that, I want him to tell me he's got a cable tester with several remote probes so he can figure that out in a small number of trips. Maybe show me how he can hook a couple together with a coupler and use the cable length function to shave a couple of trips off. Not recite a memorized brain teaser answer.

luciferofastora@feddit.org · 1 pts · 233d (1 reply)

Thr difference in phrasing is that your question presents a reasonable objective rather than an unreasonable constraint. You're also asking something subject-specific from someone who ought to be versed in that subject. That's not a riddle, it's a task you're expecting your hire to be capable of.

captain_aggravated@sh.itjust.works · 1 pts · 233d

That's kind of my point. Google started that nonsense of making job interviews into lateral thinking puzzles, then all managers latched onto that to make themselves look hip.

I want to see competence and practical problem solving skills.

PonderingPotato@discuss.tchncs.de · 11 pts · 238d

So I can't go to the other room to set up a camera?

pyre@lemmy.world · 9 pts · 237d

this is the classic answer but it also fails pure logic because the question only implies one of them actually works, and even then, it's only one of them. the truth is any number of them could work, or a specific combination, or a number of combinations, or it might be none. the bulb itself to could be busted. my point is not to be an uncooperative asshole but that a logic puzzle that relies on real world properties should cover its bases.

saimen@feddit.org · 8 pts · 238d (1 reply)

What if it's a LED bulb?

captain_aggravated@sh.itjust.works · 17 pts · 238d

LED bulbs do get warm, not as hot as incandescent bulbs but they do emit heat. You might have to run them longer than a minute to warm it up enough to be immediate about it.

vivalapivo@lemmy.today · 4 pts · 237d

the adult answer is why do I have only one chance to walk in the room?

The actual adult answer is questioning why the switch is in a different room and if it's because of safety, demand for safety protocol

tetris11@feddit.uk · 1 pts · 234d

8 lightswitch states. Smack em all on, and smack em all off. If there's no change, that's a bad lightswitch

kinkles@sh.itjust.works · 53 pts · 238d (3 replies)

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. :::

SkyezOpen@lemmy.world · 24 pts · 238d

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.

Michal@programming.dev · 5 pts · 238d (1 reply)

And there i thought this was the Monty Hall problem

Akasazh@feddit.nl · 2 pts · 238d

No that is when you finger three bums and in one of them is a goat

quinkin@lemmy.world · 44 pts · 237d

Unlabelled switches controlling lights in another room isn't Workplace Health and Safety approved.

Lockout both rooms and log a job with maintenance.

ilinamorato@lemmy.world · 42 pts · 238d (1 reply)

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.

Natanael@infosec.pub · 2 pts · 237d

"why was I not equipped with current detectors as that is standard practice in the industry?"

gustofwind@lemmy.world · 38 pts · 238d (5 replies)

The answer isn’t intuitive anymore now that lightbulbs don’t always get hot 🥲

Ledivin@lemmy.world · 31 pts · 238d (4 replies)

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.

gustofwind@lemmy.world · -9 pts · 238d (3 replies)

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

Ledivin@lemmy.world · 9 pts · 238d (2 replies)

lol

Every time you say "obviously" to an assumption, someone else gets the job.

gustofwind@lemmy.world · -3 pts · 238d (1 reply)

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

Ledivin@lemmy.world · 3 pts · 238d

Basic assumptions are why the Challenger exploded. Hopefully nobody ever hires you as an engineer.

stray@pawb.social · 37 pts · 238d (1 reply)

I don't understand. You don't need to visit a room to know whether the light is on in it.

victorz@lemmy.world · 23 pts · 238d

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.

fartographer@lemmy.world · 32 pts · 238d

"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.

usernamefactory@lemmy.ca · 25 pts · 238d

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.

GreenKnight23@lemmy.world · 23 pts · 238d (1 reply)

if asked this I would go into a complicated explanation of how I would dismantle the switches to identify if they were functioning first because of sub-par outsourced manufacturing standards.

they'd probably attempt to move on to a different question, but I would always bring it back to those shoddy light switches.

"so do you have any questions for us?"

yeah, do you know who the manufacturer of the light switches are? it's probably Leviton, but I'm hoping it's Honeywell because they're far superior in quality. you see Leviton uses brass plated contacts vs Honeywell uses full brass fittings that don't cause resistance and increases the potential for fires. are you aware that using one brand over another could reduce your insurance costs by up to 3%?

yermaw@sh.itjust.works · 8 pts · 238d

You've had some cowboys in here

NaibofTabr@infosec.pub · 22 pts · 238d

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.

Cevilia@lemmy.blahaj.zone · 20 pts · 238d
[ removed ]
reddit_sux@lemmy.world · 20 pts · 237d (2 replies)

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.

Socialism_Everyday@reddthat.com · 0 pts · 237d (1 reply)

Remove the switches put a microcontroller like esp32

ESP32 proceeds to explode with 230VAC

reddit_sux@lemmy.world · 1 pts · 236d

Don't worry I power it with a Chinese adapter nothing of blowing up happens here. Also I have an app for it.

MNByChoice@midwest.social · 16 pts · 238d

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.

aarch64@programming.dev · 16 pts · 238d

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.

MonkderVierte@lemmy.zip · 16 pts · 238d

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).

_druid@sh.itjust.works · 16 pts · 238d (2 replies)

Take the cover off, flip all three switches. Whichever terminal shocks you is completing the circuit for the light.

NaibofTabr@infosec.pub · 1 pts · 238d (1 reply)

What if there are other things wired to those switches?

_druid@sh.itjust.works · 5 pts · 238d

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.

umbraroze@slrpnk.net · 15 pts · 238d

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

Modern_medicine_isnt@lemmy.world · 14 pts · 238d

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.

strlcpy@lemmy.sdf.org · 14 pts · 237d (1 reply)

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.

usernamefactory@lemmy.ca · 16 pts · 237d

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.

SCmSTR@lemmy.blahaj.zone · 14 pts · 238d (1 reply)

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.

kryptonianCodeMonkey@lemmy.world · 12 pts · 237d

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!

sga@piefed.social · 13 pts · 238d (9 replies)
[ removed ]
Pulptastic@midwest.social · 6 pts · 238d (8 replies)

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.

sga@piefed.social · 5 pts · 238d (7 replies)
[ removed ]
xthexder@l.sw0.com · 2 pts · 238d (6 replies)

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.

Tlaloc_Temporal@lemmy.ca · 1 pts · 238d (5 replies)

Worse, if the LED is wired to the hot side it will just barely glow at all times.

xthexder@l.sw0.com · 1 pts · 237d (4 replies)

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.

Tlaloc_Temporal@lemmy.ca · 3 pts · 237d (3 replies)

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.

xthexder@l.sw0.com · 1 pts · 237d

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.

Wirlocke@lemmy.blahaj.zone · 11 pts · 238d (1 reply)

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.

xthexder@l.sw0.com · 9 pts · 238d

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.

fantacyde@lemmy.blahaj.zone · 10 pts · 238d

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."

BCOVertigo@lemmy.world · 9 pts · 238d

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.

JackiesFridge@lemmy.world · 9 pts · 238d

Literally ask someone which switch it is. Then ask them what idiot wired them up that way

JackbyDev@programming.dev · 6 pts · 238d (6 replies)

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.

Atlas_@lemmy.world · 5 pts · 238d (1 reply)

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"

JackbyDev@programming.dev · 2 pts · 238d

Like I said, it's been over a decade, some of the specifics may be lost to me.

Atlas_@lemmy.world · 3 pts · 238d (1 reply)

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.

JackbyDev@programming.dev · 1 pts · 238d

YOU'RE DOOMED! You must weigh two against two in the first step.

chaos@beehaw.org · 1 pts · 238d (1 reply)

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.

JackbyDev@programming.dev · 1 pts · 238d

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.

workerONE@lemmy.world · 5 pts · 238d

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.

stoy@lemmy.zip · 5 pts · 238d (1 reply)

Easy, take a spare phone set up a video call between that phone and your normal phone, leave the spare phone in the lightbulb room.

Go to the light switch room and start flipping switches while looking at your normal phone.

GreenShimada@lemmy.world · 3 pts · 238d

Or with one phone, set it up in a place to see the bulb and take a video. Two options:

  1. with the video recording, scream AS LOUD AS YOU CAN the number of the switch you flip on then off. Hopefully loud enough to hear it on the video. Are you in another building? scream louder!

  2. Start the video recording and you counting 1...2...3... and keep counting on second at a time, in time (or close enough) to the timestamp. Flip on the switches and make note of when you do (e.g. 30-35 sec, 40-45, 50-55) then go back and watch the video.

If it were me, I would do the first one.

Stupidmanager@lemmy.world · 5 pts · 237d

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.

danhab99@programming.dev · 5 pts · 238d
[ removed ]
mlg@lemmy.world · 4 pts · 237d (1 reply)

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.

lengau@midwest.social · 3 pts · 236d

I once had an interviewer ask me what happens when you type a domain into your browser and hit enter. "Use as much detail as you want."

Well, I did...

"For the sake of brevity, I'll start when the user presses the Enter key. As the key goes down, it makes two contacts connect, passing a current..."

skisnow@lemmy.ca · 4 pts · 238d (6 replies)
[ removed ]
d00ery@lemmy.world · 3 pts · 238d

Tbh, I quite enjoy the question / challenge. But on the other hand I've been a dev for awhile so could also easily give a long list of real world examples of clients asking me ridiculous (and sometimes interesting) questions.

Brainsploosh@lemmy.world · 3 pts · 238d (3 replies)
[ removed ]
skisnow@lemmy.ca · 1 pts · 238d (2 replies)
[ removed ]
Brainsploosh@lemmy.world · 2 pts · 238d (1 reply)
[ removed ]
skisnow@lemmy.ca · 1 pts · 238d
[ removed ]
Shanmugha@lemmy.world · 0 pts · 238d

Well...

case 1: I know beforehand that this is going to be an interview to look at how good I am at reasoning. No problem, give me the question about bus to fill with balls

case 2: this is going to be a more informal interview, question goes in the same list as "your name, what were you doing at your previous job, did you work with X... by the way, what about switches and bulbs" - nope. That means interviewer did a lousy job at preparing for interview, so who is wasting whose time - up to me to decide on the spot

gtrcoi@programming.dev · 3 pts · 233d

Check the log

rumba@lemmy.zip · 3 pts · 237d

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.

  1. ask an occupant

  2. shove a penny in the socket behind the light bulb and listen for a breaker to pop

  3. turn all three on

  4. slide your cell phone under the door with video recording on, stomp on the floor hard every time you flip a switch

  5. turn all the switches through a binary counter looking for one that seems to do nothing.

iThinkDifferentThanU@lemmy.world · 3 pts · 238d
[ removed ]
Digit@lemmy.wtf · 2 pts · 229d

Get someone else to be in the room, and shout when the light's on when trying them.

Bam. I figured it out, with me going into the room zero times.

backgroundcow@lemmy.world · 2 pts · 235d

Even knowing the "correct answer" to this riddle for as along as I remember, I don't think it is right. For someone looking for how to handle this in an interview, I'd go with this:

I will fetch a friend or colleague to look at the bulb as I test the switches because:

  • It is by far the most obvious solution that literally everyone faced with this problem actually would use. It is easy to understand and will be easy to explain to others (if you, e.g. need to present or document what you did).

  • It is also a better solution: it is by far more robust against a large number of failure modes: e.g., if it turns out you are testing the wrong switch, the bulb is broken, more than one switch turn on the light, etc.

  • It scales better: the same solution trivially extends to N number of lightbulbs controlled by M number of switches; and at large N it will save time not having to reach each bulb.

  • It gives the opportunity to interact positively with a friend/coworker. Helping each other out with small necessary tasks builds team cohesion and work environment, and thus lowers the barrier for further collaboration, making us a more effective team in the longer run.

Kolanaki@pawb.social · 2 pts · 227d (1 reply)

I'm just flipping all 3 switches and the light can stay on forever. 🤷‍♂️

cm0002@mander.xyz · 0 pts · 227d

Why that's executive material!

MonkderVierte@lemmy.zip · 2 pts · 238d

Disassemble the switch and look what's connected.

pixeltree@lemmy.blahaj.zone · 1 pts · 238d
[ removed ]
saturn57@lemmy.world · 1 pts · 228d (1 reply)

The "right" solution doesn't work. Each light switch can turn the lightbulb on by being up or being down. This means there is 3*2=6 possible cases of which light switch state turns on the light bulb. So we need to make 3 observations to bring it down to one case. An example of the original logic failing is that the light bulb being on could mean either that switch 2 being up turns it on, switch 1 being down turns it on, or switch 3 being down turn it on.

I present an alternative solution. Since the conventional solution says that we can feel its temperature, we know the light bulb is within reach. We can visit the room first, unplug the light bulb, and bring it back to the light switches. Then we can check all 2^3 permutations of light switches to see which one effects the bulb. Of course, it is likely that non affects it after unplugging it, but it could be a wireless light bulb.

Digit@lemmy.wtf · 1 pts · 227d

What if the light's on with a combination of different positions spanning 2 or all of the switches? How many possibilities then? Plus the possibility none of these switches have anything to do with that light, and the original question had a fallacious premise. Then even the possibility that the light has different states from different combinations... and/or that the light functions differently at different times, and/or different combinations of other criteria. How many possibilities do we have now? ... I can't be bothered doing the maths. I gotta get breakfast. n_n

Bluewing@lemmy.world · 1 pts · 238d (5 replies)

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.

TheSlad@sh.itjust.works · 5 pts · 238d (4 replies)

What is the purpose of having 3 switches next to eachother that all control the same light?

kopasz7@sh.itjust.works · 6 pts · 238d (2 replies)

To fulfill the requirements.

TheSlad@sh.itjust.works · 4 pts · 238d (1 reply)

The requirements clearly state that only one switch controls the bulb

kopasz7@sh.itjust.works · 3 pts · 238d

Must be an earlier revision. The PM just pinged me to add a fourth and fifth switch for "AI".

Bluewing@lemmy.world · 2 pts · 237d

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.

kubica@fedia.io · 1 pts · 238d

Thinking skills, why would those be needed?