I don’t believe in using annoyingly abstract brain-teasers as interview questions, but I like them when used recreationally. Here are a couple annoying ones I’ve heard recently:
o Can you find positive integers a,b,c where a^2 + b^2 + c^2 = 2^100?
o The Earth’s poles don’t get much sun over the course of a year, because of the direction of the axis of rotation. If we try to fix this by tilting it so the axis of rotation is in the plane of the orbit, the poles get more sun than the equator. How do we tilt it so that the poles and the equator get the same amount of sun?
o You’re one of 27 prisoners. The jailer will let you all get together once to strategize, but then it’s back to separate cells. After that, each one of you will be led individually to a room where there’s a switch, not hooked up to anything, but with visible positions A and B. You can toggle the switch or leave it alone, then go back to your cell. You don’t know the starting position of the switch.
The jailer guarantees that he’ll take everyone to the switch room multiple times; in fact, for any positive number, you can be sure everyone will visit at least that many times if the game hasn’t ended yet. Game ends when a prisoner claims that everyone has visited at least once; if he’s right, everyone goes free, and if he’s wrong, everyone is executed. What’s your strategy?
(Warning: spoilers are OK in the comments. Or send me mail — my email address is (something like) timunderscoreconverse@yodelingexclamation.com.)
Uhm. The switch one was a puzzler on Cartalk. Except there are *two* switches. I don’t think you can solve it with just one switch.
Oh. Nevermind. You say you can leave it alone. I guess that’s the same as their version where you have to flip exactly one switch.
(1) first person must know he is first
(2) set reset position to A
(3) everybody can only switch from A to B
(4) everybody needs switch from A to B if he has not done yet, otherwise do nothing
(5) first person is responsible to reset switch to A and count numbers of persons
(6) first person is the one who knows exactly how many persons have some to the room every time he entered the room
Harry —
Looks good, except for #1. The problem as stated doesn’t tell a prisoner how to determine that he is first.