Interview Prep

Sock Drawer Puzzle Answer: 3 Socks [Solved]

Sock drawer puzzle answer: 3 socks guarantee a matching pair in the dark

Answer: 3 socks. The sock drawer puzzle answer is 3 socks. With 10 black socks and 10 white socks in a drawer, and the lights out, three draws guarantee a matching pair. Two draws can leave you with one black sock and one white sock. The third sock has to match one of the two you already hold.

You reach into a drawer in the dark. Inside are 10 black socks and 10 white socks, all mixed up. You cannot look, and you take the socks out one at a time. How many socks must you take out to be sure you have a matching pair? It is a real first round brain teaser: a candidate-shared Glassdoor report lists it as the first brain teaser in a TransMarket Group trading interview, and it also appears in interview prep collections such as GeeksforGeeks. The answer is short, and the reasoning behind it is what the interviewer wants to hear.

The Sock Drawer Puzzle, Stated Clearly

The drawer holds 20 socks: 10 black and 10 white. Socks of the same color are identical. You draw one sock at a time, without looking, and you cannot put a sock back. The question asks for a guarantee, not a good chance. That one word is the whole puzzle: a lucky draw could give you a pair in two socks, but the interviewer wants the smallest number that works even in the worst case.

One point is worth stating up front: the count of socks does not matter much. Ten of each color or a hundred of each, the answer stays the same, because the number of colors is what drives it.

How the Sock Drawer Puzzle Answer Works

Walk through the draws one by one, following the unluckiest path on purpose. The worst case decides the answer.

Draw What happens What you hold
1 You pull out any sock. Say it is black. 1 black
2 Worst case: you pull out a white sock. No pair yet. 1 black, 1 white
3 It must be black or white, so it matches one you hold. A matching pair, guaranteed

After two draws you can hold one sock of each color, so two draws are not enough. After three draws you hold three socks and there are only two colors, so one color must appear twice.

The principle behind it has a name: the pigeonhole principle. If you put more items than boxes into boxes, at least one box must hold two items. Three socks into two color boxes means one color box holds two socks. The general rule follows at once: with n colors, n plus 1 draws guarantee a pair.

Why the Sock Drawer Puzzle Answer Is 3, Not 2

Most wrong answers come from confusing a good chance with a guarantee. After two draws, the chance of holding a matching pair is about 47 percent. After the first sock, 9 of the 19 socks left match its color, so the chance the second sock matches is 9 in 19. But a 47 percent chance is not a guarantee. In the other 53 percent of cases, the two socks are different colors and you walk out with one black sock and one white sock.

The other common wrong answer is 20, or some large number close to it. That comes from imagining you must empty the drawer to be sure. You do not. You only need to beat the worst case, and the worst case ends at three draws.

Three Follow-Up Variations Interviewers Ask Next

A good interviewer never stops at the first answer. Once you say 3, expect a harder version of the same question. These three are the ones that show up most often, and each one tests whether you can reuse the same worst case thinking. The sock drawer puzzle answer stays 3 no matter how many socks the drawer holds, because only the number of colors matters.

Variation 1: guarantee a black pair

Same drawer, new demand: how many socks guarantee a pair of black socks? The worst case works against you: you could draw all 10 white socks first and still hold no black pair. After those 10, the next two socks must both be black. So the answer is 12: 10 white plus 2 black. Any pair needs 3 draws. A black pair needs 12.

Variation 2: guarantee two matching pairs

How many draws guarantee two matching pairs? Four are not enough: the worst case after four draws is three of one color and one of the other, which is only one pair. A fifth draw forces the second pair. If it matches the single sock, you hold two pairs of two. If it matches the triple, you hold four of one color, which is two pairs. So the answer is 5 draws.

Variation 3: add a third color

Put 10 brown socks in the drawer as well, so there are three colors. How many draws guarantee any matching pair? The same rule applies: colors plus one, so 4 draws. And how many guarantee a black pair now? The worst case is all 10 white and all 10 brown first, then 2 black, which is 22 draws. Each extra color raises the cost of a specific pair by the full count of that color.

Goal Drawer Draws needed
Any matching pair 10 black, 10 white 3
A black pair 10 black, 10 white 12
Two matching pairs 10 black, 10 white 5
Any matching pair 10 black, 10 white, 10 brown 4
A black pair 10 black, 10 white, 10 brown 22

Three Traps That Catch Candidates

First, do not answer with a probability. Saying the chance of a pair after two draws is about 47 percent is correct arithmetic, but it does not answer the question. The question asks what you can guarantee, and a guarantee means the worst case. Say the word guarantee back to the interviewer before you start counting.

Second, do not stop at the lucky case. Two socks can match, and in real life they often do. But the interviewer is testing whether you check the unlucky path. If you answer 2, you planned for the good draw and ignored the bad one. State the worst case out loud: one black, one white, then the third sock decides it.

Third, do not let the drawer size fool you. The number 10 in the question is a red herring. Ten socks of each color or a hundred of each, the answer for any matching pair is still 3, because only the number of colors matters. The count matters only when the question asks for a specific color, as in the black pair variation. If you remember one line from this post, make it this: the sock drawer puzzle answer is 3, and the proof is the third sock.

What the Interviewer Is Testing in the Sock Drawer Puzzle

This puzzle is not really about socks. It tests whether you can tell a guarantee apart from a likelihood, and whether you can argue from the worst case instead of the average case. The pigeonhole principle is the tool, but the habit is the point: when a question says guarantee or be sure, reach for the worst case first and count from there.

It also tests precision. A candidate who says “3, because the third sock must match” has answered. A candidate who adds “and 2 fails because the first two can be different colors” has proved it. That second sentence is the difference between a guess and a solution. Interviewers notice the difference.

For interview practice, say the sock drawer puzzle answer first, then walk the three draws, then name the pigeonhole principle. That order gives the answer, the proof, and the general rule in under a minute.

Try Another Puzzle Next

If you liked this one, try the 12 Balls Puzzle Answer: Find the Odd Ball in 3 Weighings. It uses the same worst case thinking, but with a balance scale instead of a drawer.

Frequently Asked Questions

What is the sock drawer puzzle answer?

The sock drawer puzzle answer is 3 socks. With 10 black and 10 white socks in a drawer, three draws in the dark always include a matching pair, because there are only two colors.

Why is the answer 3 and not 2?

Two draws can give one black sock and one white sock, which is no pair at all. The third sock must be black or white, so it must match one of the first two.

How many socks guarantee a black pair?

Twelve. In the worst case you draw all 10 white socks first, and the next two socks must both be black.

What is the pigeonhole principle?

The pigeonhole principle says that if you put more items than boxes into boxes, at least one box must hold two items. With socks, the colors are the boxes.

Leave a Reply

Your email address will not be published. Required fields are marked *