Medium

Design a Group Expense-Splitting Ledger Object-Oriented Design Interview

Design a system where users form groups, log shared expenses using pluggable splitting strategies (equal/exact/percentage), maintain pairwise balances, and settle debts.

1. Problem Statement

Design a group expense-splitting ledger: users form groups, any member can log a shared expense split equally, by exact amount, or by percentage, the system tracks running pairwise balances, and users can settle debts fully or partially.

2. Live Coding Format

Work in the provided coding workspace while explaining your decisions to the live interviewer. Validation may use inline tests, examples, comments, or a verbal walkthrough.

3. Key Focus Areas

  • 1
    Split strategy abstraction (equal/exact/percentage)
  • 2
    Expense and Group entity modeling
  • 3
    Pairwise balance consistency
  • 4
    Settlement handling (full/partial)
  • 5
    Debt-simplification as a stretch extension

4. What Strong Candidates Should Demonstrate

  • Use the Strategy pattern so new split types do not require editing Expense or Ledger.
  • Keep pairwise balance bookkeeping consistent as expenses and settlements accumulate.
  • Validate percentage/exact splits sum correctly before committing an expense.
  • Reason about extending the design toward debt-simplification (minimizing settlement transactions).

Want interactive feedback?

Practice this problem in the live coding workspace while the interviewer probes your clarification, implementation, trade-offs, and validation.

Continue to Dashboard

Core Concepts

Object-Oriented DesignStrategy PatternLedger Modeling

Continue preparing

Build a complete software engineer mock interview plan

Related Object-Oriented Design

Design a Car Rental System

Design a car rental domain model covering vehicle categories and vehicles, branches, customers and drivers, a rental date range, rate-based quotes, reservations, pickup rental agreements, and return inspection with extra charges — preventing overlapping rentals of the same vehicle.

Related Object-Oriented Design

Design a Library Management System

Design a library that models catalog titles versus physical copies, members and librarians, checkout/return/renew/reserve flows with loan due dates, an overdue fine policy, and notifications as a boundary.

Related Object-Oriented Design

Design a Question and Answer Platform

Design a Q&A platform domain model with users, questions, answers, comments, tags, votes, an accepted-answer rule, and a reputation policy, with the voting, acceptance, and reputation invariants enforced in the model.

Related Object-Oriented Design

Design a Rare Book Condition Management System

Model the core domain objects for tracking physical condition assessments of rare library books, with immutable scan history and structured condition report generation.