System designInterview preparation
Advanced·System design·2 min read

How would you design an e-commerce platform?

Practice this question

Short explanation:

An e-commerce system coordinates browsing, stock, orders and payments, which have different consistency needs. Catalog reads can often be cached, while stock reservation and order/payment transitions need stronger protection. External payments introduce uncertain outcomes that require durable state and reconciliation.

Key points:

  • Separate catalog, cart, order, inventory and payment responsibilities.

  • Reserve stock safely and make checkout/payment requests idempotent.

  • Verify payment events and reconcile partial failures; do not trust only the browser's success page.

  • Model order state transitions explicitly and give checkout/payment attempts stable idempotency keys.

  • Release expired reservations safely, and verify provider events before changing an order to paid.

Interview point:

  • Walk through successful payment followed by a lost callback; the design should recover without charging the customer twice.
Adapted from 07_SYSTEM_DESIGN_ARCHITECTURE.md · “How would you design an e-commerce platform?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.