Smart question: the question about which switch is used to control the light when you enter the room once

Source: Internet
Author: User

Last night, I started to read the beauty of programming. I just saw an interview question in the preface. It is said that most of the early candidates for the PM position encountered this question:

There are three lights in the room, and three switches outside the room control the three lights respectively. Only when you enter the room can you see which one is on. Excuse me, how can I enter the room only once and specify which switch controls which light.

I have an idea and have not read the online answer:

Switch a switch to the on status for 10 minutes. Then, switch the switch to the off status. Then, switch the status of another switch to open, and then quickly enter the room.

The current light must be switched on and off. Next, touch the light bulb with your hands. The light bulb is under the control of the switch in the "on" status, and the remaining one is exactly matched.

Here, the temperature is usedArticle~

Well, I can't help searching the Internet. Is there any other solution? The result is that the temperature is drilled down. Well, if the conditions are met: all three are cold lights, is there a solution? I did not expect it!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.