quote

lunedì, febbraio 25, 2008

The king and the poisoned wine

There is a king, 8 bottles of wine, one of them contains poison. Who drinks the wine with poison dies after 24 hours. The king wants to figure out what is the bottle with poison in only 24 hours. Some prisoners of the kingdom are available as test drunker. You should save as much life (of the prisoners) as you can. How many tester you have to use in order to figure out what is the bottle containing wine, in 24 hours?
I had this question during the interview for a role as software engineer. You can find the solution reading the comments of this post.

Nessun commento: