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!

  • sga@piefed.social
    link
    fedilink
    English
    arrow-up
    3
    ·
    24 minutes ago

    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.

  • ilinamorato@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    edit-2
    6 minutes ago

    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.

  • MNByChoice@midwest.social
    link
    fedilink
    arrow-up
    5
    ·
    2 hours ago

    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.

  • GreenKnight23@lemmy.world
    link
    fedilink
    arrow-up
    16
    ·
    4 hours ago

    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%?

  • MonkderVierte@lemmy.zip
    link
    fedilink
    arrow-up
    14
    ·
    6 hours ago

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

  • hperrin@lemmy.ca
    link
    fedilink
    English
    arrow-up
    71
    ·
    9 hours ago

    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.

  • stray@pawb.social
    link
    fedilink
    arrow-up
    23
    ·
    7 hours ago

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

    • Victor@lemmy.world
      link
      fedilink
      arrow-up
      14
      ·
      7 hours ago

      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.

  • fantacyde@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    7 hours ago

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

  • Bluewing@lemmy.world
    link
    fedilink
    arrow-up
    5
    arrow-down
    3
    ·
    5 hours ago

    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.

  • count_dongulus@lemmy.world
    link
    fedilink
    arrow-up
    107
    arrow-down
    2
    ·
    edit-2
    12 hours ago

    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.

    • mnemonicmonkeys@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      3
      ·
      5 hours ago

      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

      • drosophila@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        10
        ·
        8 hours ago

        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.

    • Rivalarrival@lemmy.today
      link
      fedilink
      English
      arrow-up
      12
      arrow-down
      7
      ·
      8 hours ago

      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?

      • 18107@aussie.zone
        link
        fedilink
        English
        arrow-up
        21
        ·
        9 hours ago

        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.

  • spicy pancake@lemmy.zip
    link
    fedilink
    English
    arrow-up
    47
    ·
    10 hours ago

    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

  • otacon239@lemmy.world
    link
    fedilink
    arrow-up
    153
    ·
    13 hours ago

    For those that want the actual answer:

    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
      link
      fedilink
      English
      arrow-up
      179
      arrow-down
      3
      ·
      12 hours ago

      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.

      • OpenStars@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 hours ago

        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.

      • partial_accumen@lemmy.world
        link
        fedilink
        arrow-up
        110
        ·
        11 hours ago

        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
          link
          fedilink
          English
          arrow-up
          27
          ·
          9 hours ago

          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.

      • taiyang@lemmy.world
        link
        fedilink
        arrow-up
        6
        ·
        7 hours ago

        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

      • SmoothLiquidation@lemmy.world
        link
        fedilink
        English
        arrow-up
        29
        ·
        10 hours ago

        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
          link
          fedilink
          English
          arrow-up
          9
          ·
          edit-2
          8 hours ago

          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.

    • yaroto98@lemmy.world
      link
      fedilink
      arrow-up
      77
      ·
      edit-2
      13 hours ago

      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
        link
        fedilink
        arrow-up
        46
        ·
        edit-2
        12 hours ago

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

    • [deleted]@piefed.world
      link
      fedilink
      English
      arrow-up
      16
      ·
      12 hours ago

      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.

  • Cevilia (she/they/…)@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    17
    arrow-down
    1
    ·
    10 hours ago

    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.

    • Brainsploosh@lemmy.world
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      7 hours ago

      Whoosh.

      There are (at least) two layers of joke here. One is indeed referential of the self importance that is prevalent in professional settings, and that LinkedIn users are especially known for, where the joke pokes fun at this stereotype.

      The other layer is that this is a meta joke, actually showing that they understand the premise of the question, but apply the lateral thinking to the situation (rather than question) and at the same time question the practice of lateral thinking interview questions that are trendy, but typically pointless for any hiring decision.

    • d00ery@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      7 hours ago

      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.

    • Shanmugha@lemmy.world
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      edit-2
      6 hours ago

      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

  • kinkles@sh.itjust.works
    link
    fedilink
    arrow-up
    37
    ·
    12 hours ago

    Answer:

    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
      link
      fedilink
      arrow-up
      16
      ·
      11 hours ago

      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.