Oracle Interview Question
Software Engineer / DevelopersTeam: Java Developers
Country: United States
Interview Type: In-Person
Step 1: Fill the 5-liter jar.
Step 2: Empty 3 liters out of it into the 3-liter jar.
Step 3: Discard the contents of 3-liter jar.
Step 4: Empty the 2 liters in the 5-liter jar into the 3-liter jar.
Step 5: Fill the 5-liter jar again.
Step 6: Empty a liter from the 5-liter jar into the partially filled 3-liter jar (which has 2 liters in it).
Step 7: Discard the contents of the 3-liter jar.
Step 8: The 5 liter jar has 4 liters left out in it.
Fill 3
Empty it into 5
Fill 3
Empty it into 5 (you will be left with 1 on 3)
Empty 5
Pour 1 into 5
Fill 3 and empty it into 5.
5 l jar will now contain 4 l
- ashot madatyan March 15, 2012