Amazon System Design Interview: Online Store Checkout: Cart to Confirmed Order

Based on questions reported for Amazon interviews

The interviewer opens

Hi, and thanks for joining. Welcome to your interview for the software engineer role at Amazon. We'll design a system together, and you can sketch on the whiteboard on the right of your screen as you talk. If you need to step out or take a break, use the Pause button at the top right whenever you like.

The problem is in the Problem tab: it's about checkout for an online store, and it matters at Amazon because customers can never be charged wrongly or sold something we don't have. Please read through the requirements and ask anything you'd like clarified before you start drawing.

The problem

Design the checkout for an online store like Amazon: a customer reviews their cart, pays, and receives an order confirmation. No customer may ever be charged twice, and the store must never sell more of an item than it has.

Must do

  • Customer reviews cart with current prices and availability, then places the order
  • Hold stock for the cart's items while the order is being placed
  • Charge the customer through an external payment provider
  • Confirm the order to the customer once stock and payment are secured
  • Release held stock when an order fails or is abandoned

Must hold

  • A customer is never charged twice and stock is never oversold, even when the payment provider times out
  • Checkout stays available and responsive through peak shopping hours