Object-oriented design interview questionMedium
Rippling

Design an Expense Management System

Model the core domain objects, state transitions, approval policies, and audit history for an employee expense management system.

1. Problem Statement

Design an in-memory expense management system. An employee can submit an expense, it routes through one or more approvers according to a configurable policy, and eventually reaches a reimbursed or rejected state. Start by clarifying the scope and key objects.

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
    Expense entity modeling and state machine (Draft → Submitted → Approved → Reimbursed; Rejected is final)
  • 2
    ApprovalPolicy abstraction for routing rules
  • 3
    Idempotency at the service boundary
  • 4
    Immutable audit log derived from transitions
  • 5
    Separation of entity, policy, and service responsibilities

4. What Strong Candidates Should Demonstrate

  • Model an Expense entity with explicit state machine invariants and guarded transitions.
  • Separate approval routing policy from the Expense entity itself.
  • Design idempotent service operations at the object/service boundary.
  • Produce an immutable append-only audit history from state transitions.
  • Write tests, run or traced by hand, that cover state transitions and policy routing.

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 DesignState MachinePolicy AbstractionAudit Trail

Continue preparing

Build a complete software engineer mock interview plan

Related Object-Oriented Design

Design a Role-Based Password Validator

Design an extensible validator that applies different password policies to regular users, administrators, and super administrators, handles Unicode input, and rejects passwords on a forbidden or breached-password list.

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.

Related Object-Oriented Design

Design an Airline Management System

Design an airline domain model covering airports, aircraft seat layouts, scheduled flights versus dated flight instances, passengers, reservations and tickets, seat assignment, and flight status transitions.

Related Object-Oriented Design

Implement an In-Memory Rate Limiter

Design and implement an in-memory rate limiter as an object-oriented module, validate it with concrete test cases, and discuss concurrency considerations.