Webtrends Interview Question: I was asked a pretty straight... | Glassdoor

Interview Question

Software Development Engineer In Test (SDET) Interview Portland, OR

I was asked a pretty straight forward brain teaser during

  my last phone interview, which they said they don't normally do, but because I put that I was a logical problem solver on my resume they couldn't resist the opportunity to. It was the following "There are 20 different socks of two types in a drawer in a completely dark room. What is the minimum number of socks you should grab to ensure you have a matching pair?"
Tags:
brain teaser
Answer

Interview Answer

9 Answers

1

3 is the answer when the probability is 50% for either color.

Anonymous on Oct 3, 2012
0

"20 DIFFERENT socks of two type"

In my opinion It's a brain teaser not a probability question. The answer is none. There is no sock alike, so you can't get a pair.

Anonymous on Oct 4, 2012
2

3 is the answer no matter what... there are only 2 types, if you grab 3, you must have 1 of one type and 2 of the other

Anonymous on Oct 20, 2012
6

I'm not a mathematician, statistician or highly analytical but if you pick up 3 socks they could still be all the same type - even if the odds are 50%. Odds do not equal reality. So the only way to "ensure you have a matching pair"is to pick up 11 of the 20. This is the only fool proof guaranteed way to get a pair (in the real world and not the world of odds).

Anonymous on May 17, 2013
4

All of the previous answers are somehow wrong or misleading.

"Not-a-mathematician": the method you describe would ensure that you get 2 DIFFERENT socks instead of matching - and only in the situation that the ratio is exactly 50-50.

"Anonymous on Oct 20 2012": No, you could also have 3 of the same sock after grabbing 3.

"Anonymous on Oct 3": The probability has little to do here, while it is over 0%.

THE REAL ANSWER: Given that there are 2 types, and you want to get a MATCHING PAIR (not 2 different socks) you must grab 3. When you have 3, you WILL have at least 2 of the same kind, since there are only 2 kinds available.

Martti on Sep 16, 2015
0

Easy. I do this every morning when I get up.

The answer is ONE PAIR. If you are like most people and have rolled the socks together in pairs when you put them away, there is no guessing and you just grab a pair of socks.

I think it's more of a question about habits and prep. ;)

Jeremy on Jun 23, 2018
0

It says "ensure" you have a pair. So all the probability answers are dead wrong. The person who said "The answer is none. There is no sock alike, so you can't get a pair" is probably correct.

However if the question is to get two of the same type (of which there are two), then the only correct answer is 11. That is the MINIMUM number to ENSURE you have a pair--all probability aside.

Ariel Balter on Jul 6, 2018
0

It says "ensure" you have a pair. So all the probability answers are dead wrong. The person who said "The answer is none. There is no sock alike, so you can't get a pair" is probably correct.

However if the question is to get two of the same type (of which there are two), then the only correct answer is 11. That is the MINIMUM number to ENSURE you have a pair--all probability aside.

Ariel Balter on Jul 6, 2018
0

It doesn't tell you that there are 10 and 10. There could be 19 and 1. But regardless:

There IS a way to grab 2 socks and not have 2 that match. (one of each)
But there is NO WAY to grab three socks and not have 2 of them match.

Joe Sessions on Jul 16, 2018

Add Answers or Comments

To comment on this, Sign In or Sign Up.