Design Splitwise
PremiumLow-level designMedium
- Debt simplification
- Expense splitting
- Strategy pattern
Quick answer
This low-level design interview question asks you to design Splitwise. Aim for a design that is modelled as clear classes, interfaces and relationships that can handle new requirements without a rewrite. Interviewers want to see how you name responsibilities, keep classes small and reason about change.
The problem
Splitwise low level design: build the object model for an expense-sharing app like Splitwise, where friends add shared expenses, choose how each is split and see who owes whom. The hard parts are exact money with no lost paise, balances that always sum to zero, and simplifying debts into few payments.
People create groups for a trip or a flat, add expenses that one or more members paid, choose how the cost is split, and see who owes whom. Members can record a settlement when they pay someone back, and the group can ask for a simplified set of payments that clears all debts.
What must the system do?
- Split types: Equal (same share for every participant), exact (a fixed amount per participant), percentage (shares that add up to 100), and shares (for example 2:1:1).
- Simplify debts: For a group, compute a short set of payments that clears every balance, never more than one fewer than the number of members with a non-zero balance (finding the true minimum is not required).
How well must it do it?
- Exact money: Amounts are stored in minor units (paise or cents) as integers; rounding must not create or lose a single unit.
- Consistent: After every expense or settlement, the sum of all balances in a group is zero.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- Debt simplification
- Expense splitting
- Strategy pattern
- Money arithmetic
- Graph algorithms
- Observer pattern
How you’ll practise
- Requirements
- Core objects
- Class relationships
- Key flows
- Extensibility
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any low-level design round.
- Lists the use cases before writing classes
- Gives each class one clear responsibility
- Uses interfaces where behaviour is likely to change
- Applies a design pattern only when it solves a real problem
- Handles edge cases and invalid states explicitly
- Walks through one use case end to end with the model
Questions people ask about this interview question
- Which design type is this question?
- It is a low-level design question. You design Splitwise and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
- What should I cover first?
- Start with the use cases and the core entities, then the responsibilities of each one. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team