Interview Q&A / Aptitude

BeginnerQuick answer1 min readUpdated 3 Oct 2026

A pipe fills a tank in 10 hours, but a leak at the bottom can empty the full tank in 15 hours. With both working, how long does the tank take to fill?

SHORT ANSWER

30 hours. Net rate = 1/10 - 1/15 = (3 - 2)/30 = 1/30 of the tank per hour. With 30 units: the pipe adds 3, the leak removes 2, net 1 unit per hour.

Explain it simply

Pipes and cisterns is time and work with a twist: some pipes do negative work. A leak is like a friend who keeps eating the laddoos you are packing. Add the filling rates, subtract the emptying rates, and divide the tank by the net rate.

Example

Question: Fill pipe: 10 h. Leak: empties in 15 h. Both open.

  1. Tank = LCM(10, 15) = 30 units.
  2. Pipe = +3 units/h. Leak = -2 units/h. Net = +1 unit/h.
  3. Time = 30 / 1 = 30 hours.

Notice how a leak that is "slower" than the pipe still triples the filling time. Rates that nearly cancel make the time very long.

js
console.log(30 / (30 / 10 - 30 / 15)); // Output: 30

What to say in the interview

"I take 30 units as the tank. The pipe adds 3 an hour, the leak removes 2, so the net is 1 unit an hour and it takes 30 hours."

Common mistakes

  • Adding the rates as though the leak helped.
  • Subtracting times: 15 - 10 = 5 hours means nothing here.

#aptitude#pipes-cisterns

Related questions

Practise more Aptitude questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Aptitude quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.