I love these kind of things.
This one has a special place in my heart because I’ve memorized how to answer it from when i was very young.
-You fill the five gallon tank all the way.
-pour from the five gallon into the 3 gallon tank, filling it up, thus leaving 2 gallons in the 5 gallon tank
-empty the 3 gallon tank
-pour the remaining 2 gallons from the 5 gallon tank into the 3 gallon tank
-fill up the 5 gallon tank all the way
-pour from the full 5 gallon tank into the 3 gallon tank (already with 2 gallons in it)
-this will fill up the 3 gallon tank with the extra gallon, and remove EXACTLY 1 gallon from the 5 gallon tank leaving EXACTLY 4 GALLONS!
/Also, it was used in Die Hard With A Muthafuckin’ Vengeance