Product design question

Create a scalable system that creates unique IDs.

Practice this question out loud. An AI interviewer asks it, follows up like a real interviewer would, and scores your answer. Type or speak.

Start a mock interview on this question · Mock interview from a job description

What this question tests

Distributed systems design fundamentals for a classic, high-throughput unique-ID generation problem.

How to approach it

  1. Clarify requirements: throughput, uniqueness guarantee across distributed nodes, and whether IDs need to be sortable or time-ordered.
  2. Reject a single centralized counter as the sole mechanism, since it becomes a bottleneck and single point of failure at scale.
  3. Propose a Snowflake-style approach: composite IDs of timestamp, machine or node ID, and a local sequence number, generated independently with no central coordination.
  4. Address clock skew: use monotonic or NTP-synced clocks with a wait-for-clock mechanism to avoid collisions if the clock moves backward.
  5. Address node ID assignment: a lightweight coordination service to assign unique machine IDs and avoid collisions across data centers.
  6. Define success as near-zero collision rate at target throughput and low generation latency per ID.

What a strong answer includes

Common mistakes

Likely follow-up questions

More product design questions

More questions from Google

Learn the skill behind it

Chapters of the AI PM course that teach what this question tests.

Preparing for a specific role?

Book summaries for this kind of question

Browse all 4,000+ questions in the bank