Nokia Interview Question: Logic puzzle from Die Hard (3... | Glassdoor

Interview Question

Software Engineer Interview Chicago, IL

Logic puzzle from Die Hard (3 gal bucket, 5 gal bucket

 , make 4 gals)

Interview Answer

2 Answers


add 3 gal to 5 gal, add from 3 gal to 5 gal tank already filled to 3. Left with 1 gal in 3gal tank. Empty 5gal and fill with 1 gal. Fill 3gal and add to 1 gal in 5gal tank. 4 gal total.

Anonymous on Sep 16, 2012

Even simpler:
fill the 3 gal from the 5 gal full - it will be 2 gal left in the 5 gal tank.
Spill the 3 gal contents and put the 2 gal from the other tank.
Fill up the 5 gal then from it fill up the 3 gal tank (1 gal will only fit).

The 5 gal tank now contains 4 gal

Anonymous on Sep 4, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.