AI & Technical question

You're the CTO of a company. Design a program that provides unique IDs upon requests from a client. This program will be used by Facebook and Google and needs to scale.

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 for a unique ID generator at massive scale, a classic system design problem.

How to approach it

  1. Clarify requirements: IDs must be unique, roughly sortable by time for indexing, and generated at very high throughput with low latency.
  2. Rule out a single centralized counter, since it becomes a bottleneck and single point of failure at this scale.
  3. Propose a Snowflake-style approach: each ID combines a timestamp, a worker ID, and a per-machine sequence number, generated independently per node.
  4. Explain why this scales: no cross-node communication is needed per request, so throughput scales linearly with node count.
  5. Address clock skew risk: handle cases where a node's clock moves backward, which can cause collisions if unhandled.
  6. Note operational needs: worker ID assignment and monitoring for clock drift across the fleet.

What a strong answer includes

Common mistakes

Likely follow-up questions

More ai & technical 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