Object-oriented design interview questionMedium

Design a Group Expense-Splitting Ledger

Design a system where users form groups, log shared expenses split equally, by exact amounts, or by 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
    Supporting several split types (equal/exact/percentage) and adding new ones
  • 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

  • Add new split types without editing Expense or Ledger.
  • Keep pairwise balance bookkeeping consistent as expenses and settlements accumulate.
  • 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

Hidden because they name the technique, which a real interviewer would not tell you.

Show core concepts
Object-Oriented DesignExtensibilityLedger Modeling

Continue preparing

Build a complete software engineer mock interview plan

Related Object-Oriented Design

Design a Hotel Management System

Design a hotel domain model covering room types and rooms, guests, a half-open date-range value object, the reservation lifecycle, room assignment, check-in/out, and a charges folio, while preventing overbooking of a room type and overlapping stays on the same room.

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 Meeting Room Booking System

Design a class-level system for booking meeting rooms: register a room, book a meeting given a start time and duration, and cancel an existing meeting with correct conflict detection.

Related Object-Oriented Design

Design a Movie Ticket Seat Booking System

Design a multi-theater ticket booking system where users search movies/showtimes, hold specific seats from a shared seat map, and confirm the hold before it expires, with correctness under concurrent booking attempts.