Splitwise (Expense Sharing)

Track shared expenses with equal, exact, and percentage splits and settle balances.

Medium45 minSplit strategiesBalance ledgerDebt simplification

Design an expense-sharing app like Splitwise where friends record shared expenses, split them in different ways, and see who owes whom. The interesting parts are modelling split types cleanly, keeping balances consistent, and simplifying debts.

Requirements

Functional

  • Users and groups; expenses can be inside a group or between individuals.
  • An expense has a payer (or several payers), an amount, participants, and a split type: EQUAL, EXACT amounts, PERCENTAGE, or SHARES.
  • Show balances: per user ("you owe Rs 450 overall"), per pair, and per group.
  • Record settlements (A pays B).
  • Simplify debts within a group to minimise the number of transactions.
  • Edit or delete an expense and have balances update correctly.

Non-functional

  • Money in integer paise, never floats; rounding remainders must be assigned deterministically.
  • Balances always consistent with the expense history (sum of all balances is zero).
  • Concurrent expense additions to the same group must not corrupt balances.

Try it first

Set a timer, sketch your own design on paper, then compare it with the reference walkthrough.

45:00

Complete & continue

Defend it out loud

The AI interviewer will probe your design for Splitwise (Expense Sharing) and score it.

Mock interview