Glove Selection — Puzzle for Interview rounds

Placewit
2 min readJul 18, 2021

--

Question :

There are 20 gloves in a drawer: 5 pairs of black gloves, 3 pairs of brown, and 2 pairs of gray. You select the gloves in the dark and can check them only after a selection has been made. What is the smallest number of gloves you need to select to guarantee getting the following?

(a) At least one matching pair

(b) At least one matching pair of each color

Solution :

The answers are 11 and 19 gloves for parts (a) and (b), respectively.

a. In the worst case, before you get at least one matching pair, you will select 5 black gloves, 3 brown gloves, and 2 gray gloves — all for the same hand. The next glove will have to yield a matching pair. Thus, the answer is 11 gloves.

b. In the worst case, before you get one matching pair of each color, you will select all 10 black, all 6 brown, and 2 gray gloves for the same hand. The next gray glove will have to yield a matching pair. Thus, the answer is 19 gloves.

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