Medium
Amazon

Design an Online Shopping System Object-Oriented Design Interview

Design an online shopping domain model covering the product catalog, SKU inventory, shopping cart, order lines with snapshotted prices, a checkout flow, a payment boundary, and shipment state transitions.

1. Problem Statement

Design an online shopping system: customers browse a catalog, add items to a cart, and check out to create an order that is paid for and shipped. Focus on the domain model — products, SKUs and inventory, cart, order with line-item prices, checkout, payment, and shipment. Start by clarifying scope and the core 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
    Product/SKU/inventory modeling
  • 2
    Cart and cart-item quantity invariants
  • 3
    Order lines with snapshotted prices and order state transitions
  • 4
    Idempotent checkout and inventory reserve/commit/release
  • 5
    Payment gateway boundary and shipment lifecycle

4. What Strong Candidates Should Demonstrate

  • Separate Product, SKU, Cart, Order, and Shipment responsibilities cleanly.
  • Snapshot order-line prices so placed orders are immune to later catalog changes.
  • Model inventory reserve/commit/release to prevent overselling.
  • Make checkout idempotent at the application boundary and treat payment as an interface.

Want interactive feedback?

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

Start Interview

Core Concepts

Object-Oriented DesignDomain ModelingState MachineIdempotency