7
Back to Problem Dungeon

Splitwise / Expense Sharing

hard

Step 1: Requirements

Requirements

Questions to ask the interviewer

  1. What split types — equal, exact amounts, percentage?
  2. Can one expense involve people from different groups?
  3. Do we need to simplify debts (minimize transactions)?
  4. Multi-currency support?
  5. Do we track who paid (could be split payers)?
  6. Expense history and undo?

Functional requirements

  • Users can create groups and add members.
  • Any member can add an expense, specifying who paid and how to split.
  • Split strategies: equal, exact (specify each person's share), percentage.
  • Track balances between every pair of users.
  • Simplify debts: minimize the number of transactions to settle all balances.
  • View balance summary per user and per group.

Non-functional requirements

  • Balances must be consistent (no rounding drift).
  • Extensible to new split types without changing core logic.
  • Expense history is append-only (audit trail).

Assumptions

  • Single currency.
  • Single payer per expense (simplifies the model).
  • No real payment integration — just balance tracking.

1 / 7 — Requirements