Design the TikTok Coins Virtual Currency Ledger
Last updated: November 29, 2026
Quick Overview
Design the system that lets users buy TikTok Coins, spend them on LIVE gifts, and converts received gifts into creator earnings, with correct balances and an auditable history.
TikTok
November 29, 20260
0
0 solved
Design the system that lets users buy TikTok Coins, spend them on LIVE gifts, and converts received gifts into creator earnings, with correct balances and an auditable history.
Virtual gifting is a major revenue line for TikTok LIVE, and any balance error is a financial and regulatory problem across many countries. The interviewer checks double-entry ledger design, idempotency, consistency under concurrency, and reconciliation with app store and payment providers.
What the Interviewer Expects
- Uses a double-entry, append-only ledger as the source of truth
- Makes every money-moving operation idempotent
- Handles concurrent spending without overdrafts
- Integrates with app store purchases and handles refunds and chargebacks
- Reconciles internal records against external providers
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 handle a refund from the app store after coins were already spent?
- How do you prevent a user from double-spending coins on two devices at once?
- How do you scale the balance for a creator receiving thousands of gifts per second?
- How do you support different coin prices per country?
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: users buy coin packs through app stores or web payment; spend coins on gifts; creators accrue earnings from gifts; creators withdraw earnings; full history for users, creators, finance...
High-Level Design
- Purchase service: verifies app store receipts or payment provider callbacks, then credits coins.
- Ledger service: append-only journal of entries; each transaction has balanced debits and cr...