Design Flash-Sale Inventory and Ordering for Douyin Live Commerce
Last updated: November 29, 2026
Quick Overview
Design the backend that lets a Douyin livestream host launch a limited flash sale (for example 10,000 units released at a set second) to an audience of several million viewers, without overselling and while keeping checkout responsive.
ByteDance
November 29, 20260
0
0 solved
Design the backend that lets a Douyin livestream host launch a limited flash sale (for example 10,000 units released at a set second) to an audience of several million viewers, without overselling and while keeping checkout responsive.
Live commerce on Douyin creates extreme bursts where millions of taps hit one SKU in a second, which makes this a signature ByteDance e-commerce design question. The interviewer checks admission control, atomic stock deduction, async order creation, and payment timeouts that return stock.
What the Interviewer Expects
- Quantify peak QPS and show the database cannot absorb it directly
- Filter traffic early: client throttling, eligibility checks, tokens
- Deduct stock atomically in memory (Redis Lua or a stock service) before writing orders
- Create orders asynchronously through a queue with idempotency
- Release reserved stock when payment times out
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you stop bots and scalpers from taking most units?
- A Redis primary fails mid-sale: how do you avoid oversell or lost stock?
- How do you show viewers an accurate remaining-stock number without hammering the stock service?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: host releases N units at time T; viewers tap Buy; winners get an order and must pay within 10 minutes; losers see sold out quickly. Non-functional: zero oversell, p99 tap response under 20...
High-Level Design
Path: client (randomized jitter and disabled button until T) -> gateway with rate limiting and a sale token check -> Flash Sale service -> Stock service (Redis, Lua script that checks remaining > 0, d...