Skip to the guide

Design a flash sale and inventory (like Amazon Prime Day or Flipkart's Big Billion Days)

AdvancedCase study12 pages

A big shop's yearly sale opens at midnight. Every product drops its price, and limited deals open through the day: 50,000 phones at half price, gone in seconds. The system must sell each deal's units no more than once, give back units that buyers abandon, and take orders far faster than cards can be checked. Picture a market stall at opening time, with one crate of the cheap phones and a crowd that all saw the same advert.

It's also asked as "design an inventory system", "design Amazon's Lightning Deals" or, in India, "design Flipkart's sale". The closest case study is Ticket booking, where each buyer chooses a seat. Here every unit is identical, so the hard part is a count. Interviewers like it because stock spans millions of products and a few are white-hot. Overselling and underselling both cost money, and orders pile up behind the payment providers.

Below is a full mock interview following the seven steps of the framework. You're the candidate: at each Guess before you read on, stop and answer first.

Step 1 · Clarify the features and cut the scope

Minutes 0–5 · How this step works

Interviewer: Design the flash sale for a large online shop, like Prime Day.

You: Is it sale prices across the whole catalogue, or limited deals with a fixed number of units?

Interviewer: Both. About 100 million products at sale prices, and ~10,000 deals a day, about 100 opening every 15 minutes.

You: Does a shopper hold a deal's unit while she checks out?

Interviewer: Yes, she claims it for 15 minutes, one per account. Ordinary products are only checked at checkout.

You: When a deal is fully claimed, is that the end?

Interviewer: No. Shoppers join a waitlist, and abandoned units go to it.

You: Is stock kept per warehouse?

Interviewer: Yes, and we choose the warehouse after the order.

You: Then I'll cover deal and product pages, stock, claims, the waitlist, checkout and the order pipeline up to confirmation. Out: search, recommendations, pricing, delivery and returns. OK?

Interviewer: Good.

Each answer shapes the design: a claim is a decrement with an expiry, one per account is a unique key, and the waitlist decides where returned units go. Choosing the warehouse later keeps one sellable count per product.