CSE Roadmap

Core tier · about 4 hours · 6 parts

Part 1 of 6 · 1 min read

Why this page comes sixth in Level 7

In this module you will

  • Turn a shared-expense question into requirements about members, expenses, splits and settling.
  • Keep money as whole cents, and say why a decimal type for money is a trap.
  • Split an amount equally, by exact amounts and by percentages, with no cent lost.
  • Keep one net balance per person, and show that all balances always add to zero.
  • Reduce a web of debts to a short list of payments.

Splitwise looks like a table of who owes whom. The design question is smaller and sharper: how to split without losing a cent, and how to keep the books so they always balance. It uses the strategy pattern of Level 4, module 1, and the value-object thinking of Level 5, module 2. No book was supplied for this track, so the content is common practice, not from the books. The Java code was compiled and run before it was written here. Numbers marked "made up" only show the idea.