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!

  • otacon239@lemmy.world
    link
    fedilink
    arrow-up
    142
    ·
    3 months 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.

    • yaroto98@lemmy.world
      link
      fedilink
      arrow-up
      70
      ·
      3 months 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.

    • [deleted]@piefed.world
      link
      fedilink
      English
      arrow-up
      16
      ·
      3 months 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.

  • count_dongulus@lemmy.world
    link
    fedilink
    arrow-up
    103
    ·
    3 months 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
      6
      ·
      3 months 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

  • hperrin@lemmy.ca
    link
    fedilink
    English
    arrow-up
    75
    ·
    3 months 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.

  • Captain Aggravated@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    45
    ·
    3 months ago

    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
      link
      fedilink
      English
      arrow-up
      10
      ·
      3 months ago

      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.

      • Dremor@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        3 months ago

        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
          link
          fedilink
          arrow-up
          7
          ·
          3 months ago

          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
          link
          fedilink
          arrow-up
          2
          ·
          3 months ago

          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
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 months ago

          note the premise specifies HOT.

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

          ymmv.

            • mojofrododojo@lemmy.world
              link
              fedilink
              English
              arrow-up
              1
              ·
              3 months ago

              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
                link
                fedilink
                English
                arrow-up
                1
                ·
                2 months ago

                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
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  2 months ago

                  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

        • Captain Aggravated@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 months ago

          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
            link
            fedilink
            arrow-up
            1
            ·
            3 months ago

            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
              link
              fedilink
              English
              arrow-up
              1
              ·
              3 months ago

              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.

    • pyre@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      3 months ago

      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.

      • Captain Aggravated@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        14
        ·
        3 months ago

        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.

    • tetris11@feddit.uk
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 months ago

      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
    link
    fedilink
    arrow-up
    37
    ·
    3 months 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
      18
      ·
      3 months 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.

  • quinkin@lemmy.world
    link
    fedilink
    arrow-up
    35
    ·
    3 months ago

    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
    link
    fedilink
    arrow-up
    28
    ·
    edit-2
    3 months 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.

    • Ledivin@lemmy.world
      link
      fedilink
      arrow-up
      20
      ·
      3 months ago

      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
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 months ago

        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

          • gustofwind@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            3 months ago

            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
              link
              fedilink
              arrow-up
              3
              ·
              3 months ago

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

  • fartographer@lemmy.world
    link
    fedilink
    arrow-up
    21
    ·
    3 months ago

    “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
    link
    fedilink
    English
    arrow-up
    18
    ·
    3 months ago

    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
    link
    fedilink
    arrow-up
    18
    ·
    3 months 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%?

  • Cevilia (they/she/…)@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    16
    ·
    edit-2
    3 months 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 activated by a switch being moved into the “off” position. We bring the bulb through and throw the switches one by one, see what happens.

  • reddit_sux@lemmy.world
    link
    fedilink
    arrow-up
    15
    ·
    3 months ago

    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.

  • SCmSTR@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    11
    ·
    3 months ago

    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
      link
      fedilink
      arrow-up
      7
      ·
      3 months ago

      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!

  • aarch64@programming.dev
    link
    fedilink
    arrow-up
    11
    ·
    3 months ago

    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.