42. Design E-commerce Cart and Checkout (Amazon / Flipkart)
1
The interview prompt2
42.1 What do you ask first?3
42.2 How big is this, really?4
42.3 What are the doors?5
42.4 What do we store?6
42.5 What does the whole system look like?7
42.6 How is the cart stored?8
42.7 How do you reserve inventory?9
42.8 How do you make order creation idempotent?10
42.9 How does the payment hand-off work?11
42.10 How does the checkout saga work?12
42.11 What would you say in the last five minutes?13
Score yourself14
Variations to practise15
Sources16
Code lab42. Design E-commerce Cart and Checkout (Amazon / Flipkart)
The interview prompt
3 min read+10 XP
This chapter is a full interview round, played out step by step. The interviewer's lines are in quotes. At each step you'll see what a strong candidate says, the pushback the interviewer throws, and how to answer it. At the end, grade yourself with the rubric.
How to use this chapter
- Read only the prompt below. Then stop.
- Set a 45-minute timer and do the whole round yourself, on paper or a whiteboard, out loud. Use the framework from Chapter 1: READ, then Draw, Dive, Defend.
- Then read the walkthrough and compare. Score yourself with the rubric at the end.
This round ties together Chapters 17 (transactions and sagas), 22-24 (queues, events, idempotency) and 29 (failure). The cart can be relaxed; checkout can't: never sell what you don't have, never charge twice, never lose an order.
The prompt
"Design the cart and checkout for a large online store, like Amazon or Flipkart, including a big sale day."
Stop here. Start your timer.