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!

all 73 comments

sorted by: hot top controversial new old
[–] 77 points 10 months ago (3 children)

Only works if it’s an incandescent light, but…

Flip one switch. Wait a few minutes. Flip it off.

Flip the second switch and go into the room.

If the light is on, it’s the switch you flipped most recently. If the light is off but warm, it was the first switch. If it’s off and cold, it’s the switch you didn’t touch.

  • source
  • hideshow 3 child comments
  • [–] 50 points 10 months ago (4 children)

    "Do you have any questions for us?"

    "You have three engineers in one room. The order comes to let one go. Who do you let go and why?"

    "Wut?"

  • source
  • hideshow 4 child comments
  • [–] 32 points 10 months ago (3 children)

    I think I was asked this very question in an interview once. I think I answered something along the lines of 'If you have a light switch like that here in the office, the first thing I would recommend is calling in an electrician to change and move the switch to the correct room. Why would you have a light switch that controls a light in a different room and apparently two switches that do nothing??'

    Got the job.

  • source
  • hideshow 3 child comments
  • [–] 3 points 10 months ago (2 children)

    The bathroom where the switch is prone to get splashed?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 5 points 10 months ago (1 child)

    Sure, but I would still argue the bathroom light switch should be located, I don't know, next to the bathroom door? And most definitely there shouldn't be two totally useless switches there.

    I don't think I would like to work for a company that struggles this much with light switches..

  • source
  • parent
  • hideshow 1 child comment
  • [–] 25 points 10 months ago (1 child)

    Turn off all of the switches, go into the room with the bulb, smash the bulb, then the correct answer is none of the switches control the bulb. #Science

  • source
  • hideshow 1 child comment
  • [–] 18 points 10 months ago* (last edited 10 months ago) (10 children)

    if anyoen is curous on the answer, you flip one and wait till you think a light bulb gets warm enough from ambient that youd notice. you then turn that off and turn another on.

    if light = on, second switch you hit

    if light = off && bulb = warm, it was the first switch

    else switch 3

  • source
  • hideshow 10 child comments
  • [–] 11 points 10 months ago (2 children)

    Doesn't say I can't leave the door open of the room with a light, or just put someone else in the room while I flick the switchs, use a few mirrors to bounce the light back to me,

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 10 months ago* (1 child)

    of course, nothing says you can't but programming (and engineering) is not just solving the problem, but solving the problem efficiently.

    one who lacks optimization knowledge would run into situations like the rockstar employee who originally wrote the parser for GTAO that made it take over 5 minutes to load GTAO, till someone else rewrote the parser in order to get people loaded in quicker. It's basically the weed out for the devs people complain about when something uses way more resources than it needs to.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 5 points 10 months ago*

    That's not the answer. It's an answer. The question isn't very contained so there are a lot of answers. You can get someone else to switch the switches in order while you watch. Or you can install a camera in the room and then pull the switches. You can keep the door open to see which switches works, etc. Probably a million more solutions.

  • source
  • parent
  • [–] 3 points 10 months ago (5 children)

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

  • source
  • parent
  • hideshow 5 child comments
  • [–] 2 points 10 months ago (4 children)

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

  • source
  • parent
  • hideshow 4 child comments
  • [–] 4 points 10 months ago (3 children)

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

  • source
  • parent
  • hideshow 3 child comments
  • [–] 0 points 10 months ago* (2 children)

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

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

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

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 10 months ago (1 child)

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

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

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 10 months ago*

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

  • source
  • parent
  • [–] 17 points 10 months ago (1 child)

    The "correct" answer doesnt work for led bulbs. A more modern answer would be why the hell can i only go to the room once!? Or you could get a friend/coworker to go to the room and just observe the bulb. One blink switch one, two blinks switch two etc. Lastly if you know a random switch is controlling a light in another room, why the hell is that switch not labeled if you already knew about it. Like how did this problem even arise in the first place. Also if you just want light in the room right now just turn all 3 on and go to the room.

  • source
  • hideshow 1 child comment
  • [–] 36 points 10 months ago (8 children)

    It's funny to read the reactions and the people not understanding that programming questions are not enough to judge you. We need people with functioning brains and that usually means problem solving skills. And sometimes the problems are fucking idiotic! Nobody cares about the light switches. We want to see how you think. We want people who don't give up if they can't look it up.

    You think you're hot shit because you learnt the latest trendy language? I've wasted entire days with people like that because they couldn't be fucking arsed reading error messages and figuring things out by themselves.

  • source
  • hideshow 8 child comments
  • [–] 6 points 10 months ago (1 child)

    That's a much better question, though! "Here's a stack trace and the source code. Walk me through where to go from here."

    Most places use at least some open source software, so most places can do this, and if you ask your sys admin team nicely, there's probably some stack traces available, hot off the prod.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 6 points 10 months ago*

    Sure, but I've a guy working with me who's supposed to have ten years xp in the tech we use, and he's pretty fucking useless.
    Meanwhile the young front-end dev who didn't know any of our tech turns out to learn everything we throw at her after one explanation. Pure tech eval would've meant throwing her away after reading her cv.

  • source
  • parent
  • [–] 3 points 10 months ago

    I’ve wasted entire days with people like that because they couldn’t be fucking arsed reading error messages and figuring things out by themselves.

    I've had a couple interview tasks that are like "clone this repo and run it. Try to do [action]. Tell us any errors you find and how to fix them"

    One of them was some sort of redux app, and the problem was a state mutation. Another one, the CSS had some weird so stuff rendered crazy. Both were pretty easy to track down and fix. You could probably also do something that's like an error thrown, but people would probably just feed that into an AI now.

  • source
  • parent
  • [–] 8 points 10 months ago (3 children)

    Stupid interview questions show you nothing about how people think. Might as well ask them their astrological animal and blood type

  • source
  • parent
  • hideshow 3 child comments
  • [–] 12 points 10 months ago (1 child)

    On the contrary, someone can learn a lot from a question like this. If they immediately spit out the answer, then I know that they studied and came prepared to answer common questions like that. If they give a response like the OP, then I know they are an asshole to work with. If they don't know, do they ask follow up questions or ask for a moment to think can tell me how well they like to work in a group. If they talk about asking a coworker vs researching a solution independently first can tell me how they may react to a brick wall of a problem. Last thing that comes to my mind, is how long they try before giving up. That can be a good indicator for how they treat work meetings - do they push through the task one at a time and in exact order, or do they have the social skills to know when it is time to shut up and move on to the next thing.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 18 points 10 months ago

    The problem is that it sounds like a riddle. In a riddle, you're traditionally supposed to work within the rules that you've been told. So, not thinking outside the box here is not an indication that the person isn't capable of doing so.

    Of course, if I encountered this problem in real life, I'd ask Carol from accounting to check the other room, while I flip the switches. But my instinctive answer was that it is not possible, because I assumed it to be a riddle and the provided rules did not allow a solution.

  • source
  • parent
  • [–] 2 points 10 months ago*

    I've wasted entire days with people like that because they couldn't be fucking arsed reading error messages and figuring things out by themselves.

    Everyone has those days. People are not a static value.

    Which is why companies here don't do stupid tests but look if you fulfill some absolute minimum requirements and then look how you do with the team and the job for a week.

  • source
  • parent
  • [–] 12 points 10 months ago (2 children)

    Replace the Lightbulb with a paperclip then flip the switches until you hear the circuitbreaker trip

  • source
  • hideshow 2 child comments
  • [–] 2 points 10 months ago (1 child)

    All three switches are on the same circuit.

    The answer is to turn on the first one and wait ten minutes. Then turn it off and flick on the second switch and go and look at the light. If the light is off and the bulb is hot it is the first switch if its off and cold its the third switch and if its on its the second switch.

    Hope this helps.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 9 points 10 months ago (1 child)

    What would you say is your weakest bigness?

  • source
  • hideshow 1 child comment
  • [–] 9 points 10 months ago

    You’re screwed, the bulb is now LED and puts off no heat.

  • source
  • [–] 12 points 10 months ago (11 children)

    Dead serious question: I have only ever worked in the public sector (state level and local municipality) but often see or hear about these seemingly idiotic "interview questions" on television (and obviously memes).

    Is this:

    1. just a meme
    2. just a joke
    3. an actual phenomenon in the private sector

    If 3, what on earth is its purpose and what could the interviewer possibly find out about the applicant by asking this?

    I'm calm.

  • source
  • hideshow 11 child comments
  • [–] 19 points 10 months ago (4 children)

    In the private sector, I once was asked to come up with 12 uses for a kettle. I said make 12 cups of coffee. I didn't get the job.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 11 points 10 months ago (3 children)

    In the end it all boils down to heating water

  • source
  • parent
  • hideshow 3 child comments
  • [–] 16 points 10 months ago (1 child)

    I don't have experience with interacting with these questions in an interview, but I think these questions are supposed to be a test of problem solving ability, which could be relevant in some jobs like programming, I suppose. I still think it's stupid though.

    This question in particular I'm pretty sure has a BS "outside the box" answer, where "outside the box" really means "the question is very misleading and to solve it you have to realize that when we explained this scenario, we heavily implied a set of abstracted rules you could try to solve, but we actually want you to "think outside the box" and come up with a different set of rules that, if you thought we were asking this question in good faith, you would have assumed is obviously cheating", which isn't relevant to programming skills and is also just ridiculous.

    (I think the answer is :

    Tap for spoilerTurn one switch "A" on, and keep it on for some time. Turn it off, and turn another one "B" on. Go into the room. If the bulb is on, B controls it. If it's off but warm, A controls it. If it's off and cold, C controls it.
    )

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 10 months ago

    I think they're stupid too. Going into an interview is already stressful enough and these types of questions don't put me into "problem solving" mode. They put me into "brain teaser" mode which is a different type of thinking for me. You know how we nailed these questions when I was in uni? We traded them after our interviews between each other and you just had to pretend you've never heard it before. So the main thing people were testing was whether or not the question had made it to them.

    For programming, there are so many better ways to test out of the box thinking to me ... I think the "what happens when you press a letter into a web browser address bar" or something is better and at least relevant. One that I like is, "there's an outage in production, how would you go about diagnosing it?" Then as an interviewer I'd reshape the scenario and see where they put their focus and where they give up.

  • source
  • parent
  • [–] 12 points 10 months ago (2 children)

    It started when Google started hiring hoardes of people and their interview questions "that only a genius could solve" started leaking. At some point, everyone wanted to work at Google, because they had a slide and free sandwiches and whatnot.

    Then, every startup, turtlenecked steve jobs-wannabe started copying those nonsensical questions that only "gifted" people could answer.

    It's definitely a thing, praised by every linkedin lunatic, for finding people who "want to be a part of the family", are "willing to give it 1100%", and will do overtime for free to prove they're "worth it".

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 10 months ago

    There's definitely a lot of cargo cult* thinking in software. People don't understand the why of things but they want the results. That's why most "agile" I've seen is a waste of time.

    *Is there a less problematic phrase for this?

  • source
  • parent
  • [–] 8 points 10 months ago

    This is part of a series frequently known as "Microsoft interview" questions. The most famous one is, "Why is a manhole cover round?" They are partially meant to gauge your problem-solving abilities, but more importantly see how you react to a question you did not (and could not) prepare for. They've since fallen out of fashion, because it was always a terrible way to gauge roles like software developers.

  • source
  • parent
  • [–] 5 points 10 months ago* (last edited 10 months ago)

    Go in the room, smash the lightbulb. There, now it's none of the switches.

    I think I'll pass this interview no problem.

    Edit: Damn, someone beat me to it. I posted without reading the comments as instructed.

  • source
  • [–] 5 points 10 months ago (2 children)

    maybe dont care. hit all 3 of em. answer is: i have figured out that one of the 3 switches controls the bulb (or not)

  • source
  • hideshow 2 child comments
  • [–] 4 points 10 months ago (5 children)

    Gotta rewatch Alice in Wonderland

  • source
  • hideshow 5 child comments
  • [–] 4 points 10 months ago (4 children)

    I think you mean Alice in Borderland

  • source
  • parent
  • hideshow 4 child comments
  • [–] 2 points 10 months ago (2 children)

    No one should watch Borderlands.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 6 points 10 months ago (3 children)

    I assume this is a question to weed out candidates using AI as it’s not possible but AI tries to solve for it anyway.

  • source
  • hideshow 3 child comments
  • [–] 7 points 10 months ago (2 children)

    I mean, my solutions either require more information or for the question to be stupidly open-ended.

    I'm fond of "leave the door open", but that only works if the doorway is visible from the switches and the space between too bright.

    "send someone else into the room and call them" requires the freedom to do that, but end-runs the need for me to go into the room entirely.

    Gimme two smartphones and I'm video-calling one I leave in the room.

    In all of my answers and others I've seen so far, we're either making presumptions or making shit up. The question fails as an "only one right answer with only the information given" logic test, but would work to reveal how we approach problems - a personality test.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 10 months ago (1 child)

    Walk in, remove light. Now none of the switches control the light.

  • source
  • parent
  • hideshow 1 child comment
  • [+] 0 points 10 months ago* (last edited 10 months ago) (2 children)
  • [–] 0 points 10 months ago

    There is no correct answer. The problem in this comment is this is not your time, it's the interviewer's time

  • source
  • 138 comments in c/programmer_humor@programming.dev view that post