Three sock

Question:

There are three sock drawers in a bureau. The drawers are labeled White, Black, and Mixed, but every drawer is labeled incorrectly. One drawer has all white socks, one all black socks, and one mixed white and black socks. You are permitted to close your eyes and pick one sock from one drawer. How can you correctly label each drawer?

.

.

C

A

P

T

A

I

N

I

N

T

E

R

V

I

E

W

.

.

Solution: Absolutely essential is to realize the significance of the clue that every drawer is labeled incorrectly. Once that’s understood, the optimum strategy is to pick a sock from the drawer (incorrectly) labeled Mixed. Inspect the sock. If it is a white sock, then the drawer must be full of white socks. Why? Because it can’t be the Mixed drawer (for then it would be correctly labeled in the first place). The labels on the two remaining drawers are simply exchanged. If it is a black sock, then the drawer gets the Black label. The labels on the two remaining drawers are simply exchanged. The powerful clue that every drawer is incorrectly labeled allows the problem to be solved with just one inspection.

 Answer: Select from the Mixed sock drawer.

Interviewer Ole Eichorn is tough on programming candidates who can’t figure this puzzle out: “What I like about this puzzle is that it is a simple matter of working through a fixed number of choices, and this challenge comes up in programming design all the time. As with the Contaminated Pills puzzle [see puzzle 69], I really would expect to be able to coax a candidate through this problem successfully. Actually the puzzle is pretty easy, so I would hope they could figure it out for themselves.”

Microsoft interviewers have been known to frame this puzzle in the following way:

There are three vending machines dispensing, according to the signs, Coke, Sprite, and Coke or Sprite. Each of the machines is labeled incorrectly. One can costs a quarter. How many quarters do you need to correctly label the three vending machines?

Obviously, one quarter in the Coke or Sprite vending machine will do the trick.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: