System Design Problem

Design a Flash Sale System

Commonly Asked By:AlibabaAmazonFlipkartShopify

  • Scheduled sales: Admin schedules flash sale with start/end time, SKUs, quantities, discounted prices
  • Countdown timer: Show countdown to sale start; reveal items at exact start time
  • Atomic purchase: Click Buy, atomically decrement stock, reserve for payment
  • Virtual queue: Enqueue users with position if traffic exceeds capacity
  • Purchase limits: Max 1-2 units per user per SKU (prevent scalpers)
  • Real-time stock display: Show remaining stock count
  • Fairness: First-come-first-served; no advantage from refreshing
  • Anti-bot: Prevent automated bots from sniping all stock
Loading...