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
Short answer
Flipkart system design is split along one line: a huge read path for browsing and a smaller but strict write path for checkout. Catalog and search reads go through a CDN, caches and a search index; Flipkart's Aerospike fleet alone serves about 90 million queries a second. At checkout, stock is reserved with an atomic decrement and a short TTL (time to live) of a few minutes, and only committed when payment succeeds. The order then moves through a state machine with retries and compensating steps. For Big Billion Days, when traffic runs 5 to 10 times normal, a waiting room, per-user and per-item rate limits and a queue keep the database at a steady write rate.
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.
E-commerce is the canonical interview problem because a single question forces you to reconcile two opposing workloads: a massively read-heavy catalog (which wants aggressive caching and eventual consistency) and a write-heavy, contention-prone checkout (which demands strong consistency on inventory so you never sell the same unit twice). The flash-sale angle adds a thundering-herd dimension, millions of users hitting one SKU in the same second, which separates candidates who can recite CAP from candidates who can actually shape load. Interviewers use it to probe whether you understand idempotency, distributed transactions vs. sagas, cache invalidation, and graceful degradation under 10x traffic.
This page is the free part.
₹1,111 in India$25 everywhere elseonce, for the whole course
The System Design course covers the Flipkart design across a run of lessons, not one page. These 4 alone are about 188 minutes of step-by-step reading, 3 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 6 lessons. Each one teaches one piece of the Flipkart 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
During Big Billion Days, Flipkart traffic runs 5-10x its normal load, and its Aerospike fleet alone serves ~90 million queries per second at sub-millisecond latency across search, pricing, ads, and inventory.
A complete system design walkthrough of an e-commerce platform like Flipkart, built for India's Big Billion Days. We cover the read-heavy catalog and search path, the write-heavy checkout path, how inventory stays consistent without overselling during flash sales, cart reservation with TTLs, the order-management state machine (Flipkart's open-source Flux), and how to absorb a thundering herd with virtual waiting rooms, rate limits, and queues.
Where it shows up
Asked at Flipkart, Amazon, Walmart Global Tech, Myntra, Meesho, Swiggy, Zomato, PhonePe, and most product-company interviews in India. "Design an e-commerce platform / flash sale / Big Billion Days" is one of the most common SDE2/SDE3 prompts because it exercises caching, consistency, and high-write contention in a single question.
Spec sheetFlipkart
worked through below, with the maths
The hard parts of this design are taught step by step in the System Design course: Design a Payment System, Design a Rate Limiter and Idempotency.
Design a payment processing system - ACID transactions, idempotency, reconciliation, retry strategies, and the saga pattern for distributed payments.
Design a distributed rate limiting system - token bucket, sliding window, and protecting services at massive scale.
Why some operations are safe to retry and others charge you twice, and how to make everything safe.
Long-lived transactions without distributed locking, orchestration vs choreography for microservices.
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 Design a Payment Systempay 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.
Free interview questions
These three come from our System Design and Distributed Systems interview pack. Each one is free to read in full: the answer, what the interviewer listens for, the follow-ups and the common mistakes.
The whole pack: 200 questions with full answers, ₹999 · $20. All 9 packs: ₹3,000 · $49.
Show your math. Pulling numbers from thin air signals you have not thought about the load.
Registered users / monthly actives
~500M registered, ~150-200M MAU (est.)
Flipkart is one of India's two largest e-commerce platforms; public figures put the user base in the hundreds of millions. Treat exact MAU as an estimate for sizing.
Catalog size
100M+ active listings
A horizontal marketplace with millions of sellers easily reaches 9-figure SKU counts across categories. Drives the search index size and catalog cache footprint.
Baseline vs. BBD traffic
5-10x spike during Big Billion Days
Stated directly in Flipkart engineering interviews/case studies, sale traffic is 5x to 10x normal. This multiplier is the central capacity-planning input.
Read:write ratio on catalog
~100:1 to 1000:1 reads:writes
A PDP is viewed millions of times between price/stock changes. Justifies heavy caching and a separate read path from the write path.
Aerospike fleet QPS
~90M QPS aggregate, sub-ms latency
Per Aerospike's published Flipkart case study: ~90M QPS across three DCs and 50+ use cases (search bar, recommendations, ads, pricing, inventory) at sub-millisecond latency, 200+ clusters.
Flash-sale contention on one SKU
100K-1M+ requests/sec on a single hot key
A limited-stock deal (e.g., a phone) draws the whole audience to one product+inventory key in the same second, the classic thundering-herd / hot-key problem to design around.
Checkout write throughput (peak)
Tens of thousands of order writes/sec
Even a small fraction of browsers converting at peak generates a large, contention-heavy write load on the order and inventory stores.
Start by splitting the system along the read/write seam, because that split drives every other decision. The read path serves browse, search, and product detail pages; it is enormous in volume but tolerant of staleness, so it leans on a CDN, multiple cache layers, and a search index. The write path serves cart, inventory reservation, checkout, and order management; it is smaller in volume but unforgiving, it must be strongly consistent and idempotent. On the read path, a request from a browser or app first hits a CDN edge (static assets, images, and cacheable PDP fragments). Dynamic requests pass through an API gateway / load balancer into stateless service tiers. Catalog reads are served from a product service backed by a fast key-value store (Flipkart famously runs Aerospike here, serving the search bar, pricing, recommendations, ads, and inventory reads at ~90M QPS aggregate with sub-millisecond latency). Search and faceted filtering hit a dedicated inverted-index cluster (Elasticsearch/Solr-class), kept in sync from the catalog via a change stream. The source of truth for product data lives in a durable store and is denormalized into these read-optimized projections, classic CQRS. On the write path, adding to cart writes to a cart service (a low-latency KV store keyed by user). Checkout is where the interesting consistency work happens: the system reserves inventory against a strongly-consistent inventory ledger (an atomic decrement with a reservation TTL), creates an order in a "pending" state, then drives the order through a distributed workflow, payment authorization, inventory commit, packing, shipping, using a saga / state machine. Flipkart open-sourced exactly this: Flux, a state-machine orchestration framework that models order fulfillment as states (Order Created, Confirmed, Packed, Shipped) with event-driven transitions, retries, and replay. Each step is idempotent (keyed by an idempotency key derived from the order/saga id), and failed steps trigger compensating actions rather than a single big ACID transaction across services. For Big Billion Days, the architecture adds shock absorbers in front of the write path. Because traffic runs 5-10x normal and flash sales concentrate millions of users on a single SKU, you put a virtual waiting room / admission control in front of checkout, rate-limit per user and per SKU, and front the hot inventory key with an in-memory counter and a queue so the database sees a smooth, bounded write rate instead of a spike. Flipkart runs all of this on its own Flipkart Cloud Platform (FCP) over Kubernetes, bursting overflow workloads to GCP during peaks, with chaos testing and autoscaling so individual microservices scale independently based on demand. In a real interview, sketch this on the whiteboard before diving into any single box.
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.
Entry point for all client traffic. Terminates TLS, authenticates, routes to service tiers, and enforces global and per-user rate limits. During sales it also hosts admission control (virtual waiting room tokens) so the backend never sees more than it can serve. Stateless and horizontally scaled behind GSLB/DNS for geo-routing within India.
Serves product detail data (title, price, attributes, seller, availability summary). Backed by a fast KV store (Aerospike-class) holding the read projection. The durable source of truth is a separate transactional store; updates flow into the KV cache and search index via a change stream. Read-only and aggressively cached, this is the 100:1+ read side.
Inverted-index cluster (Elasticsearch/Solr-class) powering keyword search, facets, filters, sort, and autocomplete over 100M+ listings. Kept in near-real-time sync with the catalog through CDC/Kafka. Personalization and ranking signals are layered on top; recommendations are precomputed offline (the Flipkart Data Platform / 35PB Hadoop side) and served from a low-latency store.
Stores per-user carts in a low-latency KV store keyed by user id, replicated for durability across devices. Holds item references and quantities but does NOT hold inventory, adding to cart is a soft intent, not a reservation. Cart TTLs keep abandoned carts from leaking storage.
Owns the strongly-consistent stock ledger per SKU per warehouse. Exposes atomic reserve/commit/release operations with a reservation TTL. A reserve decrements available stock and creates a short-lived hold; commit finalizes on payment success; release returns stock on timeout/cancel. This is where overselling is prevented, every other component treats its number as advisory until reserve succeeds.
Creates orders and drives them through their lifecycle with a state machine / saga orchestrator (Flipkart's Flux: Order Created -> Payment Authorized -> Inventory Committed -> Packed -> Shipped -> Delivered). Each transition is idempotent and durably persisted; failures trigger compensating actions (refund, release inventory) instead of leaving partial state.
Integrates UPI, cards, net banking, wallets, EMI, and cash-on-delivery. Uses idempotency keys so a retried checkout never double-charges, and a two-phase pattern (authorize then capture) so money is only captured once inventory is committed. Talks to external PSPs/banks via webhooks; reconciliation handles async settlement.
In front of the inventory service for deal SKUs: an in-memory atomic counter (Redis/Aerospike) acts as a fast gate so the database isn't hit by the full herd; a FIFO queue smooths bursts into a bounded write rate; per-user and per-SKU rate limits and bot detection shed abusive load. Users beyond capacity get a 'sold out / try again' fast path instead of a hung request.
Caches images, static assets, and cacheable PDP fragments at edge locations close to users. Offloads the bulk of bytes from origin and is the first line of defense against a traffic spike, most of a sale page is static.
Backbone for change streams and async workflows: catalog/price/stock changes propagate to caches and search, order events drive notifications and analytics, and inventory mutations are logged for audit. Decouples producers from consumers so a slow downstream never blocks checkout.
Sends order confirmations, shipping updates, and deal alerts over email, SMS, push, and in-app channels. Driven off the event bus, rate-limited, and deduplicated so a retry storm doesn't spam users.
products. Source-of-truth catalog row. Mutated rarely relative to reads. Denormalized into the product KV cache and the search index via CDC. Keep price out of the heavily-cached…
Every table for Flipkart, its keys, and which store fits it and why.
Preventing oversell: how to atomically decrement inventory under contention. The whole interview hinges on this. Never read-then-write in application code, two requests read available_qty=1, both think they can sell, both decrement: that's the…
7 deep dives on the parts that break at scale: Preventing oversell: how to atomically decrement inventory under contention; The thundering herd: absorbing a flash sale on one SKU; Idempotent checkout: exactly one order, exactly one charge.
Strong consistency on inventory, eventual consistency on catalog. Overselling a unit is a real-money, real-customer failure, so the inventory ledger gets strong consistency and serialized decrements. The catalog is read-dominated and…
7 decisions an interviewer expects you to defend, each with the alternative and why it loses here.
The saga orchestrator crashes after inventory was reserved and payment authorized, but before the order is committed. What happens on restart?
3 follow-up questions with model answers, the interview scorecard for this question, and a mock interview on Design Flipkart with the AI tutor.
Flipkart runs much of its low-latency serving layer on Aerospike: per Aerospike's published case study, ~90 million QPS aggregate across three data centers and 50+ use cases, the homepage search bar, recommendations, ads, pricing, and inventory, at sub-millisecond latency, on 200+ production clusters managed by a team of fewer than ten engineers via the Aerospike Kubernetes Operator. The platform sits on Flipkart Cloud Platform (FCP), Flipkart's internal Kubernetes-based cloud over private India data centers, with hybrid bursting to GCP during peak events; microservices scale independently and the team runs continuous chaos testing (killing pods, simulating partial failures) to prove failover. For order orchestration, Flipkart open-sourced Flux, a state-machine framework that models fulfillment as states and event-driven transitions with retries and replay, a real, inspectable implementation of the saga pattern this page describes. Big Billion Days traffic is publicly described as 5-10x normal load, and the Flipkart Data Platform runs an 800+ node, 35PB+ Hadoop cluster powering the offline recommendation and analytics side. Note that some specific QPS and percentage figures come from vendor case studies and engineering talks rather than first-party SLAs; treat them as directionally accurate orders of magnitude, not contractual numbers.
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.
Design a Payment System
capstone / capstone
Design a Rate Limiter
capstone / capstone
Idempotency
foundation / core fundamentals
Saga Pattern
advanced / distributed systems core
Distributed Transactions
advanced / distributed systems core
Cache Stampede Prevention
foundation / caching strategies
Cache Invalidation
foundation / caching strategies
Idempotency Keys
intermediate / api design protocols
Message Queues
intermediate / messaging event systems
28 walkthroughs of the products Indian interviewers ask about, each with the real scale numbers, the architecture and the trade-offs that company had to make.
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.
free tool
Check these numbers yourself
Put in your own guesses for Flipkart and see requests per second, storage, bandwidth and servers, with every sum written out.
Open the Capacity EstimatorIt is really nice and good Please join the course