About this question
Medium · Brainteasers · Quant Trader interview question · modulo-arithmetic, state-space
You are debugging a fluid dynamics simulation. You have an infinite water source and two empty jugs: one holds 5 gallons, the other holds 3 gallons. They have no markings. How do you measure exactly 4 gallons in the 5-gallon jug?