## Interview Question: Socks

Sample Question #262 (brainteaser)

[This is a classic brainteaser question]

You get up in the wee hours of the morning and it’s still dark outside. You’re too lazy to turn on the lights and you can’t see a thing, but you open a drawer where you keep your socks. You have 10 red socks, 10 blue socks, 10 white socks, and 10 black socks, but they’re all mixed up in the drawer.

How many socks in the minimum do you need to take out of the drawer to ensure you get at least one pairing?
This entry was posted in Sample Qs. Bookmark the permalink.

### 4 Responses to Interview Question: Socks

1. Brett says:

Since there are 4 colors, you just take out 5 stocks to ensure you get at least one pair of the same color.

Bonus question: what if the number of socks of each color are different, say, 10 red socks, 2 blue socks, 5 white socks, and 30 black socks. Would the answer be the same?

[This question is almost always asked with an equal number of socks for each color.]