DSA Factory
Free Low-level design lessonsLow-level design · Stage 1 · Case studies · Step 5

Case study: expense splitter

Shared expenses, who owes whom, and the net-balance technique that settles a group with the fewest payments. About 14 minutes.

Quick check

What do the net balances of everyone in a group always add up to?

  1. AZero: every amount owed is owed to someone
  2. BThe total of all expenses
  3. CA positive number
Show the answer

Zero: every amount owed is owed to someone. Credits and debts cancel exactly.

Lock it in

4 questions on this idea

Short questions that apply the idea to new cases: trace it, work out a number, put steps in order. A wrong answer explains itself.

Answer them in your browserFree account, no card. Your progress is saved, and the idea comes back in a quick review later.
Sign up free to solve