Socks Puzzle-Puzzle for Interview rounds.

Placewit
1 min readDec 18, 2021

--

Question:

There are 10 black socks and 10 white socks in a drawer. Now you have to go out wearing your shoes.

So how many maximum number of times do you need to remove the sock from the drawer so that you can go out?

You can remove only 1 sock at a time.

You can’t look at the drawer while removing the socks.

Solution: 3

The worst case is when the socks from the first 2 pick do not match. However, in the third pick, since there are only 2 colors, the sock will match one of the socks already with me. 

This is also widely known as the "Pigeon Hole Principle".

Thanks for Reading

Placewit grows the best engineers by providing an interactive classroom experience and by helping them develop their skills and get placed in amazing companies.

Learn more at Placewit. Follow us on Instagram and Facebook for daily learning.

--

--

Placewit
Placewit

Written by Placewit

Upskilling students for tech placements!

No responses yet