Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

Launch price

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year, or $19.50 for your first year with LAUNCH50, ends 1 Nov, 18:30 UTC.

See plansStart free instead

Module 09 · System Design · The low-level design round

Who owes whom (design Splitwise)

Who Owes Whom
Who Owes Whom · Open board

Paise not decimals, three splits behind one call, five balances that add to zero, and 9 payments cut to 4.

Before you start. Five short recaps.

Lesson 44 of 73 in System Design

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year, or $19.50 for your first year with LAUNCH50, ends 1 Nov, 18:30 UTC.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • February 2011: a rent calculator that grew
  • Money first: whole paise, never decimals
  • Expense: one payment, and who owes a share of it
  • Balance: one number per person
  • Settle up: a payment is just another line
  • Debt simplification: fewer payments for the same result
  • An honest warning: greedy is good, not perfect

Terms it explains: invariant, strategy, ledger, class, low-level design round, integer, expense, balance, settle up, debt simplification, heuristic, paise, split strategy.

Review System Design