Interview Question 3764

Created by admin on Mon, 19/11/2012 - 12:10
Question: 

You are standing next to a well, and you have two jugs. One jug has a content of 3 liters and the other one has a content of 5 liters. How can you get just 4 liters of water using only these two jugs?

Language: 
Answer: 
Fill the 5 liter jug. Then fill the 3 liter jug to the top with water from the 5 liter jug. Now you have 2 liters of water in the 5 liter jug. Dump out the 3 liter jug and pour what's in the 5 liter jug into the 3 liter jug. Then refill the 5 liter jug, and fill up the 3 liter jug to the top. Since there were already 2 liters of water in the 3 liter jug,1 liter is removed from the
5 liter jug, leaving 4 liters of water in the 5 liter jug.
Solution 2:
Fill the 3 liter jug and pour it into the 5 liter jug. Then refill the 3 liter jug and fill up the 5 liter jug to the top. Since there were already 3 liters of water in the 5 liter jug, 2 liters of water are removed from the 3 liter jug, leaving 1 liter of water in the 3 liter jug.
Then dump out the 5 liter jug and pour what's in the 3 liter jug into the 5 liter jug. Refill the 3 liter jug and pour it into the 5 liter jug. Now you have 4 liters of water in the 5 liter jug.