You are given a 3-gallon jug and a 5-gallon jug. How do you use them to get 4 gallons of liquid?

Fill the 5-gallon jug completely.  Pour the contents of the 5-gallon jug into the 3-gallon jug, leaving 2 gallons of liquid in the 5-gallon jug.  Next, dump out the contents of the 3-gallon jug and pour the contents of the 5-gallon jug into the 3-gallon jug.  At this point, there are 2 gallons in the 3-gallon jug.  Fill up the 5-gallon jug and then pour the contents of the 5-gallon jug into the 3-gallon jug until the 3-gallon jug is full.  You will have poured 1 gallon, leaving 4 gallons in the 5-gallon jug.