Question bankPricingSign in

Flash Sale / Deal System

E-Commerce & PaymentsHard1:30

Design a flash sale system that can handle massive traffic spikes when limited-quantity deals go live, ensuring fairness, preventing overselling, and maintaining system stability.

Scale requirements: - Normal traffic: 100K requests/minute; flash sale spike: 10M requests/minute - Flash sale items: 100-10,000 units available - Sale duration: 30 seconds to 1 hour - 10,000+ concurrent users competing for the same item - System must remain stable for non-sale traffic during flash events

Areas to cover: 1. Traffic management and rate limiting during spikes 2. Fair queuing and user selection 3. Atomic inventory decrement under extreme concurrency 4. Isolation of flash sale load from regular platform 5. Anti-bot and fraud prevention

Constraints: - Zero overselling: never sell more units than available - Fairness: early legitimate users should have priority over bots - Non-flash-sale features (browsing, regular checkout) must not degrade - Handle 100x normal traffic without downtime - Results must be communicated to users within 10 seconds

How to approach it

  • Hint 1

    Start with traffic management: how do you absorb a 100x traffic spike without crashing? Think about layers of defense: CDN, load shedding, request queuing, and separating flash sale infrastructure from the main platform.

  • Hint 2

    Consider the fairness problem: how do you prevent bots from grabbing all units? Think about CAPTCHA, proof-of-work, randomized queue entry, and device fingerprinting. What does the user flow look like?

  • Hint 3

    Think about the hot-key problem: thousands of concurrent decrements on a single inventory counter. How do you make this both fast and correct? Consider pre-sharding the inventory across multiple counters.

Ready to answer it out loud?

Record your answer in 1:30 and Preptile scores it 1–10 with specifics — what landed, what you skipped, and what to say next time.

Practising needs an invite code. Join the waitlist and we’ll send you one.