Product design question
Create a scalable system that creates unique IDs.
- Product design
- Medium
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
- Clarify requirements: throughput, uniqueness guarantee across distributed nodes, and whether IDs need to be sortable or time-ordered.
- Reject a single centralized counter as the sole mechanism, since it becomes a bottleneck and single point of failure at scale.
- Propose a Snowflake-style approach: composite IDs of timestamp, machine or node ID, and a local sequence number, generated independently with no central coordination.
- Address clock skew: use monotonic or NTP-synced clocks with a wait-for-clock mechanism to avoid collisions if the clock moves backward.
- Address node ID assignment: a lightweight coordination service to assign unique machine IDs and avoid collisions across data centers.
- Define success as near-zero collision rate at target throughput and low generation latency per ID.
What a strong answer includes
- Names a concrete, industry-standard pattern, Snowflake IDs, rather than inventing an ad hoc scheme, showing real systems knowledge.
- Explicitly addresses the clock-skew edge case, a common failure point interviewers probe for.
- Distinguishes the need for sortability, which changes the design between random and time-ordered IDs.
Common mistakes
- Proposing a single centralized ID generator with no discussion of it being a bottleneck or single point of failure.
- Ignoring clock skew as a real failure mode in a timestamp-based scheme.
Likely follow-up questions
- How would you handle a data center outage affecting node ID assignment?
- How would you migrate from a legacy ID system without downtime?
More product design questions
- Design a TV for a car.Google · Product design · Hard
- Design a refrigerator for the blind.Google · Product design · Hard
- How do you design a camera for the elderly?Google · Product design · Medium
- Redesign Twitter for eCommerce.Shopify · Product design · Hard
- How would you go about designing a new location sharing app for Google?Google · Product design · Medium
- How would you improve Google Home?Google · Product design · Easy
More questions from Google
Learn the skill behind it
Chapters of the AI PM course that teach what this question tests.
- Chapter 4: Discovery and strategy for AI products
- Chapter 7: AI UX and human oversight: design for a system that is wrong sometimes
- Chapter 14: Get the job: the AI PM interview loop