Skip to the guide

Design expense sharing (like Splitwise)

IntermediateCase study11 pages

The interviewer asks you to design an app that friends use to share bills. Picture friends on a trip with one shared notebook. Each page says who paid and who shared the cost. The last page has one number beside each name, plus if the group owes you and minus if you owe the group, and those numbers always add up to zero.

No other case study is close, because nothing here is scarce and nothing races. Interviewers like it for the money: a bill that won't divide evenly, and who should pay whom.

Below is a full 45-minute round on the LLD framework. At each Guess before you read on, stop and answer first. The full runnable project is a download in Java, JavaScript and Python.

Run the full project

This design as a project you can run, with its tests and a demo. You only need Java 21, Node 24 or Python 3.13. The README says how to run it.

Step 1 · Clarify the requirements and cut the scope

Minutes 0–5 · How this step works

Interviewer: Design an expense-sharing app.

You: How can a bill be split?

Interviewer: Equally, by exact amounts or by whole percentages.

You: How big is a group, and is it one currency?

Interviewer: From 2 to 50 people, in dollars. Two friends are a group of two. The largest expense is $100,000.

You: What must people see?

Interviewer: Each person's balance, the list of expenses they were part of, and a plan with as few payments as possible to settle up.

You: Can an expense be deleted?

Interviewer: Yes, and the balances go back.

You: Then I'll build addExpense, deleteExpense, settle, the balances, a statement and the plan. Logins, reminders and other currencies are out. OK?

Interviewer: Good.

Three kinds of split become an interface with one class each. "As few payments as possible" decides what the balances store, and "the balances go back" means an expense is kept whole.