Riddle For Your Enrichment & Possibly Amusement

This is an old riddle that many puzzle fans will have heard before. It’s not new to me, and I’m not a big fan of it.

But, a friend of mine was recently posed this brainteaser during a technical interview, and she hadn’t heard it before. As a public service, I now re-present to you this old riddle, that you may ace your next interview.

You have two jugs of water. One holds three gallons and one holds five gallons, though they are otherwise unmarked. You also have a sink that you can get water out of or dump excess water into. Your task is to measure out exactly four gallons of water.

For the record, I am opposed to using this kind of question on an interview; it is 90% “have you heard this question before”, 8% sangfroid, and no more than 2% of whatever mental ability the interviewer is hoping to measure.