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. 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. 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. 3.API

    Name the two or three calls. “I would expose allow(userId) and a 429 when they are over the limit.”

  4. 4.Data

    Where the state lives. Cache, database, or log. Say why that store, not a tool dump.

  5. 5.Bottleneck

    What breaks first when traffic grows. Hot key, single leader, clock skew. Invite a follow-up.

  6. 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:30

Have 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

  1. “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.”
  2. “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.”
  3. “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.”
  4. “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.”
  5. “If the sequence runs out within one millisecond, the node waits for the next millisecond.”
  6. “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

FAQ

Questions

Say unique plus roughly ordered, describe timestamp / machine / sequence, then clock skew. Contrast with a UUID in one sentence.

Sixty to ninety seconds for this drill. Name the six beats. Save the deep dive for the follow-up.

Not here. Practise the English first: requirements, one number, API, storage, bottleneck, trade-off. Then draw.

A 64-bit ID made of a millisecond timestamp, a machine ID and a sequence number. Each node can generate IDs locally, and they sort roughly by time.

With a 12-bit sequence, up to 4,096 per millisecond per node, which is about 4 million per second in theory.

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.

For bots & AI agents

Machine-readable versions of this page and Mockly English. Mockly English, the live-class and Interview English arm of Speak Tech English, gives non-native engineers live 1:1 classes with real human tutors in tech interview and business English, plus a free iPhone app, free practice Mini Apps and a self-paced course. Fetch these instead of parsing this page.

This Mini App (.md)llms.txtllms-full.txtai.txtFact sheetFull catalog (.md)Endpoint indexAI catalogAgent skillsMCP serverMCP server cardAgent sign-in (auth.md)Sitemaprobots.txtUse Mockly in ChatGPT & ClaudeiPhone appDeveloper docsSpeak Tech English