AlgoMaster Logo

Design Unique ID Generator

Ashish

Ashish Pratap Singh

10 min read

Let’s begin by clarifying the requirements.

1. Clarifying Requirements

A system design interview should always start with a conversation to scope the problem. Here’s an example of how a candidate–interviewer discussion might flow:

After gathering the details, we can summarize the key system requirements.

1.1 Functional Requirements

  • Unique ID Generation: Generate globally unique IDs across distributed services. Each ID must fit within 64 bits.
  • Time Ordering: IDs should be K-sortable, meaning they roughly increase with creation time.

1.2 Non-Functional Requirements

  • High Availability: The service must be resilient to node failures. Aim for 99.99% availability.
  • Scalability: The system must scale to handle very high throughput (millions of IDs/sec).
  • Low Latency: ID generation should be extremely fast (e.g., <2ms).

2. Approaches to ID Generation

Premium Content

This content is for premium members only.