Learning on Web Dev Open is free for all.

Interview Prep · Low Level DesignDesign an expense-splitting app
← Low Level Design

Design an expense-splitting app

Medium40 minFree, no account

Money that must balance to the cent, and a settlement graph worth simplifying.


The question

Design the core of Splitwise: people in a group record expenses, split them in several ways, and settle up.

Show who owes whom, minimising the number of payments.

Functional
  • Record an expense: payer, amount, participants, split type (equal, exact, percentage, shares).
  • Show each person's net balance in a group.
  • Suggest a minimal set of payments to settle.
  • Record a settlement payment.
Non-functional
  • Balances must sum to exactly zero. No cent may be created or lost.
  • History is immutable: an edit is a correcting entry, not an overwrite.
40:00Commit to an answer before you open the solution. Reading it first teaches you to recognise good answers, which is not the skill being tested.

Stuck?

0 of 3 hints taken

The worked solution

written by a person · not a grade

Score yourself

0 of 5 marked
  • Integer money with a deterministic remainder rule25
  • Split strategies behind an interface with the sum invariant20
  • Net balances derived from an immutable log rather than pairwise debts25
  • A settlement algorithm with an honest bound20
  • Edits modelled as corrections10

We run no AI here and nothing on this page grades you. The score is yours, and the useful number is the one you get on the same problem a month from now, cold.

kept in this browser only