Asking the right questions
The three-switch-one-bulb riddle is sometimes asked as a job interview question. If you're not familiar, it goes something like this:
Three switches before you are wired up to a lightbulb inside of a sealed, opaque box. All of the switches and the lightbulb are off. You may toggle each switch as many times as you like, but only before you open the box, and you can only open the box once. Can you determine which switch controls the bulb?The answer is generally along the lines of:
Turn on any two switches, wait a few minutes, turn off one of the two "on" switches, open the box, and touch the bulb. If the bulb is off and cold, it's controlled by the untouched switch. If the bulb is off and hot, it's controlled by the switch turned off before the box is opened. If the bulb is lit, it's controlled by the switch left on.Typically, the question ends there, and the interview moves on. Popular Mechanics even calls this solution "a satisfying answer." However, there's a critical follow-up question, and I wonder how many interviewers ask it:
Which unspoken conditions make the above answer true?Off the top of my head, I can think of a few. The expected solution assumes:
- The answerer is allowed some amount of time and to touch the bulb
- There are no intervening devices wired between the switches, the box, or the bulb
- The wiring configuration of the system is static
- The bulb is not wired in such a way that its state is determined by a combination of switch positions
The first assumption is required by the solution. The second assumption confirms that only the switches may affect the bulb's state. The third assumption guarantees the "correct" switch actually controls the bulb by being able to do so repeatedly. The fourth assumption may seem to violate a rule typically given in the prompt, that "one switch controls the lightbulb," but that's not true. Until the correct combination is selected by setting the state of the last switch, the states of the other two switches do not affect bulb at all, so only the last (one) switch affects the bulb. And there may be more assumptions that I haven't thought of yet.
You may say, "Citrus, that's awfully pedantic," and you'd be right. But the ability to identify hidden conditions is critical in any job that involves problem solving. Sometimes, jumping the gun is disastrous, so it pays to check assumptions and prevent oversights from turning into problems in the first place. Another way to approach this is:
Which of the declared conditions are required to make the above answer true?
In some ways, I think this question is even more important, and--not to undermine myself--it highlights the silliness of posing riddles to candidates at all. Think about the three-switch-one-bulb problem in a real-life situation (for example, while fixing the bathroom fan once, I needed to figure out which circuit breaker controlled the electricity going to the bathroom). What if there are more than three switches? What if the bulb was already on to begin with? What if some of the switches are unlabeled and wired upside-down; how would you know which position is "on"? What if you can't touch the bulb? What if the bulb is broken? What if a switch was broken? What if one of the switches shorts the whole circuit and catches everything on fire? What if, a long time ago, the electrician you thought you hired actually subcontracted the work to his drunk friend, and all of this was just a way long-winded way for me to blow off some steam from having to unwind the mess he made in my walls?
Anyway, I leave you with three takeaways:
- As much as we'd like them to, riddles are rarely analogous to real-life problems.
- If you're currently job-seeking, I wish you the best. Sometimes, you can learn more about an employer from an interview question than the employer will learn about you. Use this to your advantage.
- If you're currently hiring, I hope you evaluate your questions scripts often. Think about the kinds of responses you'll receive and how informative (or uninformative) they'll really be. Are the clever questions useful?
Thank you for reading!
interesting and thought evoking
ReplyDelete