Work and Time Problems Explained — Formulas, Tricks and Traps
Work and Time problems show up in almost every aptitude test, placement exam, and technical interview screening round. They're not just academic puzzles — scheduling systems, CI/CD pipeline parallelism, database query optimization, and resource planning all rely on the same underlying math. When a tech lead estimates that splitting a task across three developers will cut delivery time, they're doing work and time arithmetic in their head. Getting fluent at this isn't optional if you want to ace quantitative rounds.
The reason most people struggle with these problems is that they try to memorize a dozen different formulas for a dozen different scenarios. That's the wrong approach. Every work and time problem — no matter how twisted — collapses into one core idea: work = rate × time. Once you see that, you stop memorizing and start reasoning. The formula variations you'll see in exams are just algebraic rearrangements of that single equation.
By the end of this article you'll be able to solve problems involving single workers, combined workers, workers joining midway, pipes filling and draining tanks, and efficiency-based problems — all from first principles. You'll also see the three mistakes that cost candidates marks even after they understand the concept, and you'll walk away with a mental model that's fast enough to use under exam pressure.
The One Core Idea: Work as a Rate, Not a Duration
Most people read 'A can finish a job in 10 days' and think of 10 days as the answer to something. Flip that instinct. The useful number is 1/10 — the fraction of the job A completes in ONE day. That single conversion unlocks every problem in this category.
Why think in fractions? Because fractions add cleanly. If A does 1/10 of the job per day and B does 1/15 per day, together they do 1/10 + 1/15 per day. You find a common denominator, add, and invert to get the combined time. No exotic formula needed — just fraction addition.
This 'rate-first' thinking also protects you in problems where workers join at different times or where a pipe drains while another fills. You track rates, multiply by the time each rate was active, and the fractions of work done must sum to 1 (one complete job). That constraint — total work = 1 — is your equation in every single problem.
Commit this to muscle memory: if a person completes a job in N days, their daily work rate is 1/N. Everything else is algebra.
# ───────────────────────────────────────────────────────────────── # Work and Time — Core Rate Model # TheCodeForge.io # ───────────────────────────────────────────────────────────────── # PROBLEM: Alice finishes a report in 10 days, Bob in 15 days. # How long do they take working together? from fractions import Fraction # Step 1 — Convert durations to daily work RATES (fraction of job per day) alice_daily_rate = Fraction(1, 10) # Alice does 1/10 of the job each day bob_daily_rate = Fraction(1, 15) # Bob does 1/15 of the job each day # Step 2 — Combined rate is simply the sum of individual rates # (They work in parallel, so their contributions add up each day) combined_rate = alice_daily_rate + bob_daily_rate print(f"Alice's daily rate : {alice_daily_rate} (= {float(alice_daily_rate):.4f} of the job)") print(f"Bob's daily rate : {bob_daily_rate} (= {float(bob_daily_rate):.4f} of the job)") print(f"Combined daily rate: {combined_rate} (= {float(combined_rate):.4f} of the job)") # Step 3 — Time = Total Work / Rate # Total work is always 1 (one complete job) total_work = Fraction(1) days_together = total_work / combined_rate # 1 ÷ (1/6) = 6 print(f"\nDays to finish together: {days_together} days") print(f"In decimal : {float(days_together):.2f} days") # ───────────────────────────────────────────────────────────────── # BONUS: Verify by checking work done in 6 days # ───────────────────────────────────────────────────────────────── alice_work_done = alice_daily_rate * days_together bob_work_done = bob_daily_rate * days_together total_done = alice_work_done + bob_work_done print(f"\nVerification:") print(f" Alice's share in {days_together} days: {alice_work_done}") print(f" Bob's share in {days_together} days : {bob_work_done}") print(f" Total work done : {total_done} ✓") # Must equal 1
Bob's daily rate : 1/15 (= 0.0667 of the job)
Combined daily rate: 1/6 (= 0.1667 of the job)
Days to finish together: 6 days
In decimal : 6.00 days
Verification:
Alice's share in 6 days: 3/5
Bob's share in 6 days : 2/5
Total work done : 1 ✓
Workers Joining Mid-Job — The Staged Work Pattern
Exam questions love to introduce complexity by having workers join or leave partway through. These look scary but the strategy is identical: track how much work each worker completes in their active window, make sure all the fractions sum to 1.
Break the timeline into stages. In each stage, identify who is working and for how long. Calculate the fraction of work done in each stage. Set the sum equal to 1 and solve for the unknown.
A classic variant: 'A works alone for some days, then B joins and they finish together.' You don't know when B joined — that's what you're solving for. Let the unknown be the number of days A worked alone. Write the equation, solve it. The algebra is simple once the setup is clear.
Another variant flips it: both start together, then one leaves. Same logic — two stages, two rate-time products, sum to 1. The only thing changing between problem variants is who is active in each stage. The mathematical skeleton never changes.
# ───────────────────────────────────────────────────────────────── # Staged Work Problem — Worker Joins Mid-Job # TheCodeForge.io # ───────────────────────────────────────────────────────────────── # PROBLEM: # Carlos can build a website alone in 12 days. # Diana can build it alone in 8 days. # Carlos starts alone. After some days, Diana joins. # They finish the rest together. Total time = 9 days. # How many days did Carlos work alone before Diana joined? from fractions import Fraction carlos_rate = Fraction(1, 12) # Carlos completes 1/12 of the site per day diana_rate = Fraction(1, 8) # Diana completes 1/8 of the site per day total_days = 9 # We know the project finished in 9 days total # ── Setup ──────────────────────────────────────────────────────── # Let 'd' = number of days Carlos worked ALONE. # Then Diana joined and they worked TOGETHER for (9 - d) days. # # Work done by Carlos alone + Work done together = 1 # carlos_rate * d + (carlos_rate + diana_rate) * (9 - d) = 1 # # Solve for d: combined_rate = carlos_rate + diana_rate print(f"Carlos daily rate : {carlos_rate}") print(f"Diana daily rate : {diana_rate}") print(f"Combined daily rate: {combined_rate}") # Expanding the equation: # (1/12)*d + (5/24)*(9 - d) = 1 # (1/12)*d + (45/24) - (5/24)*d = 1 # d*(1/12 - 5/24) = 1 - 45/24 # d*(2/24 - 5/24) = 24/24 - 45/24 # d*(-3/24) = -21/24 # d = (-21/24) / (-3/24) = 7 # Let's compute it programmatically step by step # Work equation: carlos_rate*d + combined_rate*(9-d) = 1 # => d*(carlos_rate - combined_rate) = 1 - combined_rate*9 rhs = Fraction(1) - combined_rate * total_days # Right-hand side lhs_coefficient = carlos_rate - combined_rate # Coefficient of d days_alone = rhs / lhs_coefficient days_together = total_days - days_alone print(f"\nCarlos worked alone for : {days_alone} days") print(f"Both worked together for : {days_together} days") # ── Verification ───────────────────────────────────────────────── work_by_carlos_alone = carlos_rate * days_alone work_done_together = combined_rate * days_together total = work_by_carlos_alone + work_done_together print(f"\nVerification:") print(f" Work done by Carlos alone : {work_by_carlos_alone}") print(f" Work done together : {work_done_together}") print(f" Total : {total} ✓")
Diana daily rate : 1/8
Combined daily rate: 5/24
Carlos worked alone for : 7 days
Both worked together for : 2 days
Verification:
Work done by Carlos alone : 7/12
Work done together : 5/12
Total : 1 ✓
Pipes and Cisterns — When a Worker Subtracts Work
Pipes and cisterns problems are work-and-time problems wearing a disguise. An inlet pipe filling a tank is exactly like a worker doing positive work. An outlet pipe (leak) draining the tank is a worker doing negative work — it un-does progress.
The model is identical: convert each pipe's time to a rate (fraction of tank per hour), assign inlet pipes a positive rate and outlet pipes a negative rate, sum all rates, and invert to find total time.
The one extra wrinkle is the 'leak' problem: a full tank empties in X hours when the drain is open alongside the inlet. Here you know the net rate (zero progress if the tank stays full, or slow fill/drain if it doesn't) and solve for the unknown pipe's rate. Always label clearly which rates are positive and which are negative before writing any equation — that's the step where most errors creep in.
Real-world resonance: this is exactly how engineers model fluid systems, battery charge/discharge rates, and even request queues where work arrives and gets processed simultaneously.
# ───────────────────────────────────────────────────────────────── # Pipes and Cisterns — Inlet, Outlet and Leak Problems # TheCodeForge.io # ───────────────────────────────────────────────────────────────── from fractions import Fraction # ── PROBLEM 1: Two inlets, one outlet ──────────────────────────── # Pipe A fills the tank in 6 hours (POSITIVE — adds water) # Pipe B fills the tank in 4 hours (POSITIVE — adds water) # Pipe C drains the tank in 12 hours (NEGATIVE — removes water) # All three are open. How long to fill an empty tank? print("=" * 50) print("PROBLEM 1: Two inlets + one outlet") print("=" * 50) pipe_a_rate = Fraction(1, 6) # fills 1/6 of tank per hour pipe_b_rate = Fraction(1, 4) # fills 1/4 of tank per hour pipe_c_rate = -Fraction(1, 12) # drains 1/12 of tank per hour (NEGATIVE) net_rate = pipe_a_rate + pipe_b_rate + pipe_c_rate print(f"Pipe A rate : +{pipe_a_rate} per hour") print(f"Pipe B rate : +{pipe_b_rate} per hour") print(f"Pipe C rate : {pipe_c_rate} per hour (drain)") print(f"Net rate : {net_rate} per hour") if net_rate > 0: time_to_fill = Fraction(1) / net_rate # Total work (1 full tank) / rate print(f"Time to fill: {time_to_fill} hours = {float(time_to_fill):.2f} hours") else: print("Tank will never fill — outlet is too fast!") # ── PROBLEM 2: The leak problem ─────────────────────────────────── # A tank has an inlet pipe that fills it in 9 hours. # Due to a leak at the bottom, it actually takes 12 hours to fill. # How long would the leak alone take to empty a FULL tank? print("\n" + "=" * 50) print("PROBLEM 2: Finding the leak rate") print("=" * 50) inlet_rate = Fraction(1, 9) # inlet fills 1/9 per hour net_fill_rate = Fraction(1, 12) # actual observed fill rate (with leak) # net_fill_rate = inlet_rate + leak_rate # => leak_rate = net_fill_rate - inlet_rate (will be negative) leak_rate = net_fill_rate - inlet_rate print(f"Inlet rate (fills) : +{inlet_rate} per hour") print(f"Observed net rate : {net_fill_rate} per hour") print(f"Leak rate (drains) : {leak_rate} per hour") # leak_rate is negative — take absolute value to get drain time leak_empty_time = Fraction(1) / abs(leak_rate) print(f"\nLeak alone empties the full tank in: {leak_empty_time} hours") # ── PROBLEM 3: Alternate opening (open one, close other) ───────── # Inlet fills in 3 hours. Outlet drains in 4.5 hours. # They alternate: inlet open for first hour, outlet for second, repeat. # How long to fill the empty tank? print("\n" + "=" * 50) print("PROBLEM 3: Alternating pipes") print("=" * 50) inlet_rate2 = Fraction(1, 3) # fills 1/3 per hour outlet_rate2 = Fraction(1, Fraction(9, 2)) # drains 2/9 per hour (4.5 = 9/2) net_per_2hr_cycle = inlet_rate2 - outlet_rate2 # net fill in each 2-hour cycle print(f"Inlet rate : {inlet_rate2} per hour") print(f"Outlet rate : {outlet_rate2} per hour") print(f"Net fill per 2hr cycle: {net_per_2hr_cycle}") # After how many full 2-hour cycles is the tank nearly full? tank_filled = Fraction(0) hours_elapsed = 0 cycle = 0 while tank_filled < 1: # Hour 1 of cycle: inlet open tank_filled += inlet_rate2 hours_elapsed += 1 if tank_filled >= 1: break # Tank filled during inlet hour — stop here # Hour 2 of cycle: outlet open tank_filled -= outlet_rate2 hours_elapsed += 1 cycle += 1 print(f"\nTank fills after : {hours_elapsed} hours") print(f"Full cycles completed: {cycle}") print(f"Tank level at end : {tank_filled} ✓")
PROBLEM 1: Two inlets + one outlet
==================================================
Pipe A rate : +1/6 per hour
Pipe B rate : +1/4 per hour
Pipe C rate : -1/12 per hour (drain)
Net rate : 1/3 per hour
Time to fill: 3 hours = 3.00 hours
==================================================
PROBLEM 2: Finding the leak rate
==================================================
Inlet rate (fills) : +1/9 per hour
Observed net rate : 1/12 per hour
Leak rate (drains) : -1/36 per hour
Leak alone empties the full tank in: 36 hours
==================================================
PROBLEM 3: Alternating pipes
==================================================
Inlet rate : 1/3 per hour
Outlet rate : 2/9 per hour
Net fill per 2hr cycle: 1/9
Tank fills after : 17 hours
Full cycles completed: 8
Tank level at end : 1 ✓
Efficiency and Wages — When Workers Aren't Equal
Real exam problems add one more layer: workers have different efficiencies, or you need to split wages proportional to work done. This feels like a new topic but it's just the rate model extended.
If Worker X is twice as efficient as Worker Y, X's daily rate is twice Y's daily rate. You don't need a new formula — just express one rate as a multiple of the other, then solve the same equation you always write.
For wage problems: wages are split in the ratio of work done. If A does 3/5 of the job and B does 2/5, their wages split 3:2. Find the total work each person contributed, form the ratio, apply it to the total payment. You never need to find the absolute amount of work — ratios are enough.
A nasty variant is 'group work': if 6 men and 8 women complete a job in 10 days, and 26 men and 48 women complete it in 2 days, find a man's and woman's individual rates. This is just two simultaneous equations with two unknowns — set up both equations using the rate model and solve.
# ───────────────────────────────────────────────────────────────── # Efficiency Ratios and Wage Distribution # TheCodeForge.io # ───────────────────────────────────────────────────────────────── from fractions import Fraction # ── PROBLEM 1: Relative efficiency ─────────────────────────────── # Priya is 25% more efficient than Raj. # Raj alone takes 20 days to finish a task. # How long does Priya alone take? print("=" * 55) print("PROBLEM 1: Relative Efficiency") print("=" * 55) raj_rate = Fraction(1, 20) # Raj does 1/20 per day # Priya is 25% more efficient => her rate is 1.25x Raj's rate priya_rate = raj_rate * Fraction(125, 100) # Fraction avoids float errors priya_days = Fraction(1) / priya_rate # Time = 1 / rate print(f"Raj's daily rate : {raj_rate} (takes 20 days)") print(f"Priya's daily rate: {priya_rate} (25% faster)") print(f"Priya takes : {priya_days} days = {float(priya_days):.1f} days") # ── PROBLEM 2: Wage split by work contribution ──────────────────── # Emi finishes a project in 10 days. Sam finishes it in 15 days. # They work together and earn ₹5000 total. # How much does each person earn? print("\n" + "=" * 55) print("PROBLEM 2: Wage Split Proportional to Work Done") print("=" * 55) emi_rate = Fraction(1, 10) sam_rate = Fraction(1, 15) joint_rate = emi_rate + sam_rate days_taken = Fraction(1) / joint_rate # 6 days together # Work done by each person over 6 days emi_work_share = emi_rate * days_taken # = 6/10 = 3/5 sam_work_share = sam_rate * days_taken # = 6/15 = 2/5 print(f"Days taken together : {days_taken}") print(f"Emi's work share : {emi_work_share} of total job") print(f"Sam's work share : {sam_work_share} of total job") print(f"Ratio : {emi_work_share} : {sam_work_share} => " f"{emi_work_share.numerator}:{sam_work_share.numerator}") total_payment = 5000 # Wages split in ratio of work done emi_wage = total_payment * emi_work_share sam_wage = total_payment * sam_work_share print(f"\nEmi earns : ₹{emi_wage}") print(f"Sam earns : ₹{sam_wage}") print(f"Total : ₹{emi_wage + sam_wage} ✓") # ── PROBLEM 3: Group work — simultaneous equations ──────────────── # 4 men + 6 women complete a job in 8 days. # 3 men + 7 women complete it in 10 days. # Find: daily rate of 1 man and 1 woman. print("\n" + "=" * 55) print("PROBLEM 3: Group Work (Simultaneous Equations)") print("=" * 55) # Let m = daily rate of 1 man, w = daily rate of 1 woman # Equation 1: (4m + 6w) * 8 = 1 => 4m + 6w = 1/8 # Equation 2: (3m + 7w) * 10 = 1 => 3m + 7w = 1/10 # # Solve using substitution / elimination: # From eq1: 4m = 1/8 - 6w => m = (1/8 - 6w) / 4 # Substitute into eq2: # 3 * [(1/8 - 6w)/4] + 7w = 1/10 # (3/8 - 18w) / 4 + 7w = 1/10 # 3/32 - 18w/4 + 7w = 1/10 # 3/32 - 9w/2 + 7w = 1/10 # 3/32 + 5w/2 = 1/10 # 5w/2 = 1/10 - 3/32 = 16/160 - 15/160 = 1/160 # w = (1/160) * (2/5) = 2/800 = 1/400 w = Fraction(1, 400) # one woman's daily rate m = (Fraction(1,8) - 6*w) / 4 # derived from equation 1 print(f"1 man's daily rate : {m} (takes {1//m} days alone)") print(f"1 woman's daily rate: {w} (takes {1//w} days alone)") # Verify both original equations assert (4*m + 6*w) * 8 == 1, "Equation 1 check failed" assert (3*m + 7*w) * 10 == 1, "Equation 2 check failed" print("Both group equations verified ✓")
PROBLEM 1: Relative Efficiency
=======================================================
Raj's daily rate : 1/20 (takes 20 days)
Priya's daily rate: 1/16 (25% faster)
Priya takes : 16 days = 16.0 days
=======================================================
PROBLEM 2: Wage Split Proportional to Work Done
=======================================================
Days taken together : 6
Emi's work share : 3/5 of total job
Sam's work share : 2/5 of total job
Ratio : 3/5 : 2/5 => 3:2
Emi earns : ₹3000
Sam earns : ₹2000
Total : ₹5000 ✓
=======================================================
PROBLEM 3: Group Work (Simultaneous Equations)
=======================================================
1 man's daily rate : 1/200 (takes 200 days alone)
1 woman's daily rate: 1/400 (takes 400 days alone)
Both group equations verified ✓
| Problem Type | Key Equation Setup | What You Solve For |
|---|---|---|
| Two workers together | (1/A + 1/B) × T = 1 | T = combined time (AB)/(A+B) |
| Worker joins midway | Rate₁×d + (Rate₁+Rate₂)×(T−d) = 1 | d = days first worker was alone |
| Pipe + leak (inlet known, net known) | Net rate = inlet rate + leak rate | Leak rate (negative), then invert |
| Efficiency ratio given | Faster rate = k × slower rate | Invert faster rate for their solo time |
| Wage split | Wages ∝ work done = rate × time worked | Each person's share in total payment |
| Group work (m men + w women) | Set up 2 equations, solve simultaneously | Individual man's and woman's daily rates |
🎯 Key Takeaways
- Convert every duration to a rate (1/N per day) before doing any arithmetic — adding times directly is the single most common error in this topic.
- Total work always equals 1 (one complete job). That constraint is your equation — write it first, then fill in the rate × time products for each stage.
- Outlet pipes and leaks carry negative rates. Assign the sign correctly before summing, and every pipe/cistern problem becomes identical to a worker problem.
- Wage splits equal the ratio of work done, which equals the ratio of individual rates when workers work the same duration — so the split ratio is always B:A for workers with times A and B (swap the numbers).
⚠ Common Mistakes to Avoid
- ✕Mistake 1: Adding times instead of rates — If A takes 6 days and B takes 4 days, candidates write combined time = (6+4)/2 = 5 days. That's dead wrong. The correct approach is to add rates (1/6 + 1/4 = 5/12 per day) and invert (12/5 = 2.4 days). Always convert to rates before adding anything.
- ✕Mistake 2: Forgetting that a leak/outlet is a negative rate — Candidates see 'inlet fills in 9 hours, with leak it fills in 12 hours' and compute leak time as 12−9 = 3 hours. That's not how rates work. Correct approach: net_rate = 1/12, inlet_rate = 1/9, leak_rate = 1/12 − 1/9 = −1/36, so the leak empties the tank in 36 hours — not 3.
- ✕Mistake 3: Using the two-person shortcut (AB)/(A+B) for three or more workers — The formula only works for exactly two workers. With three workers (times A, B, C), you must add all three rates: 1/A + 1/B + 1/C, then invert. Using the pairwise shortcut repeatedly gives a wrong answer that looks plausible, making it hard to catch under exam pressure.
Interview Questions on This Topic
- QA, B and C together finish a job in 6 days. A and B together finish it in 10 days. How many days does C alone take? Walk me through your reasoning step by step.
- QTwo pipes fill a tank in 12 and 18 hours respectively. A drain empties the full tank in 9 hours. If all three are opened simultaneously on an empty tank, will the tank ever fill? If yes, when?
- QA is twice as efficient as B. Together they finish a job in 14 days. A tricky follow-up: if A leaves 7 days before completion and B finishes the rest alone, how many total days does the project take?
Frequently Asked Questions
What is the formula for work and time problems when two people work together?
The combined time T = (A × B) / (A + B), where A and B are the times each person takes alone. This comes from adding their rates (1/A + 1/B) and inverting. For three or more workers, add all rates individually and invert — the two-person shortcut doesn't extend.
How do you solve pipes and cisterns problems with a leak?
Treat the leak as a pipe with a negative rate. Find the inlet's rate (1/fill_time), find the net observed rate (1/actual_fill_time), and subtract: leak_rate = net_rate − inlet_rate. The result is negative — its absolute value inverted gives you how long the leak alone takes to empty a full tank.
Why do wages get split in the ratio of individual work rates and not equal shares?
Wages compensate for work done, not time spent. If two workers spend the same time on a job but one is faster and contributes more output, they deserve more pay. The work done by each person equals their rate multiplied by time worked — so wages split in the same ratio as rates (when time is equal). This is why the wage ratio for workers with solo times A and B is always B:A.
Written and reviewed by senior developers with real-world experience across enterprise, startup and open-source projects. Every article on TheCodeForge is written to be clear, accurate and genuinely useful — not just SEO filler.