HLD-241·Payments & Ledger
Medium · 1,000 ptsGroup Expense Splitting & Debt Simplification Service
Design a Splitwise-style shared expense tracker and minimum-transfer debt graph engine supporting itemized splits, idempotent settlement recording, and zero-drift group net balances.
Max p99
≤ 55 ms
Availability
≥ 99.6%
Budget
≤ $5,550
Functional Requirements
- FR-1POST /v1/groups/{group_id}/expenses — Validates split sum equals total cents, appends immutable ledger entries, and recomputes simplified net balances.
- FR-2GET /v1/groups/{group_id}/balances — Returns pairwise or graph-simplified "who owes whom" summary and paginated expense feed.
- FR-3PATCH & DELETE /v1/groups/{group_id}/expenses/{expense_id} — Appends compensating adjustment/reversal entries and invalidates cached group balances.
- FR-4Concurrent edits or settlements inside the same group_id must never corrupt zero-sum net balances (sum of member balances == 0).
Workload Profile
Everyday Dining & Rent Splits28,000 Balance Read RPS / 4,500 Expense & Settle Write RPS
Holiday Group Travel Peak74,000 Read RPS / 12,500 Write RPS
Active Working Set24 GB active trip groups, net-balance graphs & recent splits
Ledger InvariantStrict zero-sum group balance invariant + idempotent expense_id writes
Consistency Model
Serializable per-group ledger mutation + synchronous/quorum replication so concurrent splits and settlements never drift.
Solutions Locked
Sign in and either achieve AC or complete 3 official submissions on this question to inspect community diagrams and writeups.
Loading solutions...
Submission History (0)Select to replay
No submissions yet
Click Submit in the top bar to evaluate against all 7 judge cases and save each run here.
Click an item in Inventory above, or press B to add a component, double-click to name, C to connect.
Design Write-up
Write under ### Architecture for Diagram to take that up directly
Compulsory section · if not written yet, Diagram reads from the start of your write-up.
Architecture: required·FRs mentioned: 0/4·0 boxes · 0 edges
0 words