System design · spoken drill
Free Unique ID Generator System Design in English
Unique IDs are a “unique, roughly ordered, and cheap to mint” story. Name a Snowflake-style split, then clock skew — that is the follow-up they will ask.
The prompt
Design a service that mints unique IDs for many machines. In 60–90 seconds, in English, say what unique means, how you avoid a single database, and what happens if a clock jumps.
How to explain it
1.Requirements
Who the user is, and what must work on day one. Clarify identity, write vs read, and one thing you are not building yet.
2.Scale
One rough number you can say out loud. QPS, storage, or “millions of keys.” The number can be rough. The sentence cannot be missing.
3.API
Name the two or three calls. “I would expose allow(userId) and a 429 when they are over the limit.”
4.Data
Where the state lives. Cache, database, or log. Say why that store, not a tool dump.
5.Bottleneck
What breaks first when traffic grows. Hot key, single leader, clock skew. Invite a follow-up.
6.Trade-off
What you gain and what you give up. Accuracy vs speed, consistency vs availability. One pair is enough.
- “I need IDs that are unique and roughly time-ordered.”
- “I would use a timestamp, a machine id, and a sequence.”
- “The follow-up is clock skew.”
Practise out loud
Record 60–90 seconds. Play it back, then get a scorecard. Audio is scored and discarded.
This browser cannot record audio. Type your explanation below.
0:00 / 1:30Have a diagram already? Explain my diagram on the hub.
Model spoken script
I need IDs that are unique across machines and roughly time-ordered, without a single database on the write path. I would use a Snowflake-style ID: timestamp, machine id, and a sequence. That lets each node mint IDs locally. The bottleneck is clock skew — if a node’s clock jumps backwards you can collide. I would refuse to mint until the clock catches up, or keep the last timestamp. The trade-off is a UUID, which is unique and simple, but not sortable and larger on disk.
How to explain a unique ID generator out loud, step by step
In one sentence: You have to design a way for many servers to create IDs independently that never clash and still sort roughly by creation time.
What to say, in order
- “First the requirements: IDs must be unique across all machines, fit in 64 bits, sort roughly by time, and be generated without a central database on every request.”
- “A single auto-increment database would work, but it's a bottleneck and a single point of failure, so I'll generate IDs locally on each node.”
- “I'd use a Snowflake-style layout: a timestamp in milliseconds in the high bits, then a machine ID, then a per-millisecond sequence number.”
- “In the classic layout that's 41 bits of time, 10 bits of machine ID and 12 bits of sequence, so each machine can mint up to 4,096 IDs per millisecond.”
- “If the sequence runs out within one millisecond, the node waits for the next millisecond.”
- “Because time is in the high bits, IDs sort roughly by creation time across machines — roughly, not strictly, because clocks on different machines differ slightly.”
Key English phrases for a unique ID generator
- k-sorted / roughly time-ordered
- — IDs are mostly in time order, not perfectly
- epoch
- — the custom start time the timestamp counts from
- machine or worker ID
- — a number unique to each generator node
- clock skew / clock moving backwards
- — a node's clock jumps or differs from others
- single point of failure
- — one component whose failure stops the whole system
How to say the time and space complexity
“Generating an ID is O(1) and purely local — no network call. With 41 bits of milliseconds, the timestamp lasts about 69 years from the chosen epoch, and 10 bits allow 1,024 machines.”
These numbers follow directly from the bit widths, so you can derive them aloud: 2 to the 41 milliseconds is about 69 years.
Communication mistakes on a unique ID generator
- Mistake: Saying 'I'll just use a UUID' and stopping there. Instead: Say what you give up: a random UUID is 128 bits and not time-ordered, which hurts index locality in a database.
- Mistake: Not explaining how each machine gets its machine ID. Instead: Say 'from configuration, or assigned at start-up by a coordination service like ZooKeeper.'
- Mistake: Claiming the IDs are strictly ordered across machines. Instead: Say 'roughly time-ordered', because clocks are never perfectly in sync.
Likely follow-up questions
Interviewer: “What if a node's clock moves backwards?”
You: “The node remembers the last timestamp it used. If the clock is behind it, the node refuses to generate IDs and waits until time catches up, or fails loudly if the gap is large. Otherwise it could reissue an ID.”
Interviewer: “Why not UUID version 7?”
You: “UUIDv7 puts a millisecond timestamp first, so it's also time-ordered and needs no machine ID coordination. The trade-off is size: it's 128 bits, twice as large as a 64-bit Snowflake ID.”
Other prompts
Spoken outline
Rate limiter
A rate limiter is a “who, how many, what happens at the limit” story. Clarify identity, pick token bucket or a window, place it before expensive work, then name fairness.
Spoken outline
URL shortener
A URL shortener is two paths: write a long URL, redirect a short code. Name how you mint the ID, where you store the map, and what you do on a collision.
Spoken outline
Unique ID generator
Unique IDs are a “unique, roughly ordered, and cheap to mint” story. Name a Snowflake-style split, then clock skew — that is the follow-up they will ask.
FAQ
Questions
More questions? Email us at contact@mocklyenglish.com.
Article: Seven-step system design walkthrough in English · System design English
Quick answer
Explain system design in English with a spoken order: clarify requirements, give one scale number, name the API, say where state lives, name what breaks first, then one trade-off. Short sentences beat a silent diagram.
Related in this path
People like you
Practise in the course
Think out loud in English