You have a 3-litre bucket, a 5-litre bucket, and an infinite supply of water. How can you measure out exactly 4 litres?
Let's look at the quantities you can measure out. Dunk the 3-litre bucket in the infinite well and pull it out: there's your 3 litres. Dunk the other bucket and there's 5 litres. To measure any other quantity, you need to resolve an ambiguity in the statement of the problem. What operations are you allowed to do in order to "measure out exactly" a quantity?
Had you super-graduated cylinder vision, you might, just by eyeballing it, pour exactly 1 litre out of the full 5- litre bucket. That would solve the problem. Evidently, you can't do that or there'd be no puzzle.
Surely you're allowed to add two quantities. Should you contrive to get 2 litres in the 3-litre bucket and 2 litres in the 5-litre bucket, you could pour the 3-litre bucket's contents into the 5-litre bucket, giving you 4 litres.
Adding quantities, by itself, doesn't get you anywhere. You can't even use it to get 3 + 3 = 6 litres, for the 5-litre bucket isn't big enough to hold 6 litres. You might think of pouring the measured water into a bathtub, empty swimming pool, dry lakebed, anything. Your interviewer won't allow this. You have to imagine you're on a planet consisting entirely of ocean, and these two buckets are the only vessels in the world.
Since there is no way of proceeding by adding quantities alone, you must also be permitted the slightly more difficult operation of subtracting. Fill the 5-litre bucket to the brim and carefully pour the water into the empty 3-litre bucket until it is full. Then stop! As long as you didn't spill anything, you've then got 2 litres in the 5-litre bucket. Leave the 2 litres in the 5-litre bucket and you'll never get any farther. The only way to move forward is to empty the 3-litre bucket and pour the 2 litres from the 5- litre bucket into the 3-litre bucket.
Now all you need to do is refill the 5-litre bucket to the brim. Carefully pour it into the 3-litre bucket until the water reaches the top. That drains off exactly 1 litre, leaving 4 litres in the 5-litre bucket. An alternate solution (requiring one additional pouring operation) is to fill the 3-litre bucket and pour it into the 5-litre bucket. Refill the 3-litre bucket and use it to top off the 5-litre bucket (leaving 1 litre in the 3-litre bucket). Now empty the 5-litre bucket. Pour the 1 litre of water into the empty 5-litre bucket. Refill the 3-litre bucket and transfer its contents into the 5-litre bucket, making 4 litres.