Lesson 15 of 16
42. Design E-commerce Cart and Checkout (Amazon / Flipkart)

Sources

3 min read+10 XP

Source notes

  • Conditional updates, optimistic locking and sagas: see Chapter 17. Idempotency keys and webhooks: Chapter 24. Outbox: Chapter 23.
  • Order volumes, cart sizes, hold durations and sale-day peaks are interview assumptions agreed in Step 1, not figures for any real store. Arithmetic computed 2026-10-08.
  • Cart merge and re-pricing, oversell vs conditional reservation, expiring holds, idempotent order creation, the payment state machine (including late payments) and the saga with compensations: tested 2026-10-08 (code/ch42_checkout.py, all checks pass).