Tower Research Capital LLC Interview Question: Another was a puzzle: A king ... | Glassdoor

Interview Question

Senior Software Developer Interview New York, NY

Another was a puzzle: A king orders 100 bottles of wine for

  a celebration. A courtier who's angry with the king over something puts poison in one of those bottles. The king has a way of identifying the poisoned bottle by giving a few drops of wine to a monkey. Since the poison is fast acting, the monkey will die immediately. Whats the minimum number of monkeys needed to find the poisoned bottle?
Tags:
analytical, difficult
Answer

Interview Answer

6 Answers

3

Assuming that there is only one poisoned bottle, then you only need one monkey- because as soon as it dies, you found the bottle. However, if there is more than one bottle, or suspicion of more than one bottle, you will need at least two monkeys.

MF on Jul 17, 2010
1

you need only one monkey since you will keep giving him wine till he dies and as soon as he's dead you know that was the bottle.

LC on Jul 27, 2010
0

I think it means we can only test once. So the minimum # of monkeys is 99, is it?

RY on Oct 12, 2011
13

The answer is 7. Let monkeys be numbered 1-n. Each number less than or equal to 100 can be written as a 7 bit number. Hence, bottle one(0000001) is given to monkey 1. bottle three(0000101) is given to monkeys 1 and 3 and so on. Now say monkeys 1 3 5 died, it means that the number is 0010101 which means the bottle 41 is the poison!

Sri Krishna on Mar 23, 2012
0

The way it's written, it seems like one would be the answer, or perhaps considering a monkey's tolerance for wine, N = 100 / (number of drops of wine a monkey can drink before passing out)... When asked with the condition that the monkey will die some time later, i.e. not immediately, the binary number technique described by Sri Krishna is best.

Anonymous on Oct 15, 2012
0

make the courtier drink it

Anonymous on Nov 22, 2017

Add Answers or Comments

To comment on this, Sign In or Sign Up.