We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design and AI Engineering, by Roni Das. 984 interactive lessons.
Start LearningSystem design interview guide
in this guide
7 parts open to everyone · 3 with a free account · 3 with the course
You can read 7 of 13 parts. A free account opens the deep dive; the course opens all of it.
Design Amazon spans more subsystems than any other interview problem. Interviewers use it to test whether you can decompose a giant problem into independent services, pick the right database per service, and handle a transactional pipeline (order to fulfillment) without losing inventory or charging twice.
This page is the free part.
₹1,111 in India$25 everywhere elseonce, for the whole course
The System Design course covers the Amazon design across a run of lessons, not one page. These 4 alone are about 108 minutes of step-by-step reading, 1 of them with code you run in the browser, all with a quiz.
Always clarify these in the first 5 minutes of the interview. Do not start drawing boxes until both lists are agreed.
This guide is built on these 5 lessons. Each one teaches one piece of the Amazon design above, step by step.
Lifetime access for ₹1,111 in India or $25 elsewhere. Interactive diagrams, quizzes, and 20 capstone projects to practise on.
This one question is not enough for the interview.
Each question has why it is asked, a full answer, what the interviewer listens for, the follow-ups, the common mistakes and a diagram (268 diagrams in all). A PDF you keep, junior to staff level.
Two courses by the author of this page:
770 lessons · 18 free to read
₹1,111 in India · $25 elsewhere, once
Get System DesignYou own this course
214 lessons · 10 free to read
₹1,333 in India · $35 elsewhere, once
Get Generative AI and Agentic AIYou own this course
Save your progress and get the interview checklist PDF
Amazon.com processes 1.6 million orders per day at peak with a catalog of 350 million products, inventory across 175 fulfillment centers, and Prime delivery guarantees in 2 days or less.
Designing Amazon means designing an e-commerce stack from catalog and search through cart, checkout, inventory, payment, and fulfillment routing. It is one of the broadest system design problems because every step is a real subsystem with its own constraints. The hardest piece is keeping inventory consistent across 175 warehouses while serving sub-second search.
Where it shows up
Commonly asked at Amazon, Meta, Google, Walmart, Shopify, Flipkart, and any e-commerce or marketplace company. The Amazon variant is often more inventory-heavy than the Shopify variant.
Spec sheetAmazon
worked through below, with the maths
The hard parts of this design are taught step by step in the System Design course: Saga Pattern, Database Sharding and Idempotency.
Long-lived transactions without distributed locking, orchestration vs choreography for microservices.
Splitting a database across multiple servers, the nuclear option for scaling writes, and the architecture behind Instagram, Uber, and YouTube.
Why some operations are safe to retry and others charge you twice, and how to make everything safe.
How key-value databases work, how to design good keys, and how Redis, DynamoDB and etcd compare. Includes a diagram of a GET and SET operation.
all part of
System Design Masterclass
770 lessons · about 287 hours · 18 free to read
₹1,111in India, by UPI
$25everywhere else, by PayPal
You own this course
Continue with Saga Patternpay once,
yours for life
Live from the course bench
Real interview questions, live diagrams and measured lab results, pulled at random from the lessons. A new set every time you come back.
Show your math. Pulling numbers from thin air signals you have not thought about the load.
Active customers
300M
Public reporting. Includes Prime and non-Prime.
Orders per day (peak)
1.6M
Average is ~1M, peak around Prime Day is 30x. Sized for the peak.
Products in catalog
350M
Public reporting. Includes third-party seller inventory. Sizes the search and catalog stores.
Search queries per second (peak)
200K
Browse traffic is much higher than buy traffic. Search peaks during Prime Day and holiday shopping.
Inventory writes per second (peak)
5K
Every order is multiple inventory decrements (one per line item). Plus restocks from suppliers.
Customer-facing services: Catalog Service serves product detail pages from a denormalized read store; Search Service runs on a custom inverted-index system (A9 internally) consuming a Kafka feed of catalog updates; Cart Service stores carts in a sharded KV store (DynamoDB) keyed by customer_id; Checkout Service orchestrates the order placement saga across Pricing, Tax, Inventory, Payment, and Order services. Order placement: when checkout confirms, the Order Service writes a pending order, reserves inventory in the Inventory Service (transactional decrement against the relevant SKU and fulfillment center), captures payment via the Payment Service (idempotent), and commits the order. The fulfillment center is selected by the Fulfillment Routing Service based on inventory availability and geographic proximity. Post-order: events go to Kafka and feed downstream services (notifications, ML training, analytics).
In a real interview, sketch this on the whiteboard before diving into any single box.
Walk through each service. The interviewer wants to hear what each one owns, not just the names.
Serves product detail pages. Backed by a denormalized read store (DynamoDB) with a separate write store for catalog updates. Heavy use of caching because catalogs change slowly.
Custom inverted index (Amazon's A9 internally). Consumes a Kafka feed of catalog updates. Indexes title, description, brand, attributes, and reviews. Ranks by relevance, popularity, and personalization.
Stores per-customer cart in DynamoDB keyed by customer_id. Carts persist for guest users via cookies and merge on login. Eventually consistent reads are fine.
Owns SKU and fulfillment-center inventory counts. Decrement on order reservation is a strong-consistency operation. Replenishment events update counts from supplier ingestion.
Owns the order lifecycle. Writes to a sharded SQL store (relational because orders have complex state transitions). Emits OrderCreated, OrderPaid, OrderShipped events.
Captures payment from saved methods. Idempotent on order_id. Integrates with internal Amazon Pay, external card networks, and gift cards.
Selects which fulfillment center ships each line item. Optimizes for proximity (delivery speed), inventory availability, and operational cost.
Personalized product recommendations on the home page and product detail pages. Trained offline on order history. Uses a two-stage candidate-generation plus ranking pattern.
products. Sharded by product_id hash. Denormalized for read performance. Updated by a separate catalog ingestion pipeline.
Every table for Amazon, its keys, and which store fits it and why.
The order placement saga. Order placement spans multiple services (Inventory, Payment, Order, Fulfillment) and must be all-or-nothing from the customer's perspective. A distributed transaction…
4 deep dives on the parts that break at scale: The order placement saga; Inventory consistency across 175 fulfillment centers; Search at 200K QPS over 350M products.
Saga vs distributed transaction for order placement. Distributed transactions are slow, brittle, and lock-prone. Sagas with compensating actions are eventually consistent but recover cleanly from failures. Sagas win in any…
5 decisions an interviewer expects you to defend, each with the alternative and why it loses here.
On Prime Day a deal has 1,000 units in one fulfillment center and 100,000 people press buy in the same second. What breaks and how do you fix it?
3 follow-up questions with model answers, the interview scorecard for this question, and a mock interview on Design Amazon with the AI tutor.
Amazon's e-commerce stack is the famous example of microservices at scale: ~10,000 services as of the most recent public statements. DynamoDB was invented at Amazon to handle the cart and checkout workload. The Order Service is built on a homegrown saga orchestrator. Search runs on A9, a custom inverted-index service. Fulfillment uses a custom routing optimization service. Recommendations use a combination of collaborative filtering and deep learning. Prime Day traffic is handled by aggressive pre-warming, capacity reservation, and chaos engineering exercises in the months before.
If any of these topics are fuzzy, the interviewer will catch it. Each lesson is 15 to 60 minutes with diagrams, code, and a quiz.
interview readiness
Three questions from this guide. Answer them without scrolling up, the way you would have to in the room.
India: UPI, cards or netbanking through Razorpay. Elsewhere: card or PayPal. Download at once from My packs.
NEWSystem Design Hands-On
Postgres Sharding: Complete Hands-On (PgBouncer + Citus). 2 h 36 min and 20 chapters: one PostgreSQL loaded until it breaks, then four shards behind a router you write, PgBouncer and Citus, with the 139-page slide deck. The first 15 minutes are free to watch.
Free PDF · 79 pages
25 real tech interview questions, answered in full
Five from each of our AI, GenAI, Inference, Maths for ML and Forward Deployed packs. Each with a diagram and a model answer. Free by email.
It is really nice and good Please join the course