← flipster Interview Insights

flipster·Backend Engineer·Onsite - System Design / Architecture·Senior

Senior
Jun 2026

Summary

Flipster system design round, focused entirely on building a distributed ID generation service. Pretty deep technically, they wanted specifics on almost every component rather than a high-level sketch.

Questions Asked (1)

Q1

Design a distributed service that generates unique 64-bit IDs at high throughput, covering bit layout, collision avoidance across nodes, clock skew, sharding, sortability, and failure scenarios like clock rollback or duplicate machine IDs.

System DesignTechnical Trade-offsAlgorithms & Data Structures
Author's notes

This is basically the Snowflake ID question and I knew the shape of it going in, which helped.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (throughput, latency, sortability, availability) and then propose a Snowflake-like 64-bit ID layout: timestamp, machine ID, and sequence. Discuss how to assign machine IDs, handle clock skew and rollback, and shard the ID generation service for scalability. Finally, cover failure scenarios and trade-offs.

Pro tip: Emphasize that clock rollback is inevitable in distributed systems; propose a solution like waiting until the clock catches up or using a monotonic clock, and mention that duplicate machine IDs can be avoided with a coordination service like ZooKeeper or etcd. Also, highlight that sortability by time is often desired for database indexing.

1. Clarify Requirements and Constraints

Ask about expected throughput, latency, sortability, and availability requirements. Determine if IDs need to be roughly time-ordered and if the system must be globally unique across data centers.

2. Design Bit Layout

Propose a 64-bit layout: 1 sign bit (0), 41 bits timestamp (ms since custom epoch), 10 bits machine ID, 12 bits sequence. This allows ~69 years, 1024 machines, and 4096 IDs per ms per machine.

3. Handle Machine ID Assignment and Clock Issues

Use a coordination service (ZooKeeper, etcd) to assign unique machine IDs. For clock rollback, either wait until clock catches up or use a monotonic clock; for clock skew, use NTP and allow small drift.

4. Scale and Shard the Service

Deploy multiple instances of the ID generator, each with a unique machine ID. Shard by machine ID or use a load balancer to distribute requests. Consider a separate service for ID generation or embed in application.

5. Address Failure Scenarios and Trade-offs

Discuss handling duplicate machine IDs (e.g., via leases), clock rollback (e.g., fail fast or wait), and network partitions. Compare with UUIDs and other approaches.

Key Points to Mention

  • Snowflake-like bit layout: timestamp, machine ID, sequence
  • Machine ID assignment via coordination service (ZooKeeper/etcd) with leases
  • Clock rollback handling: wait, use monotonic clock, or fail
  • Sharding and scaling: multiple instances, each with unique machine ID
  • Sortability: timestamp in high bits enables time-ordered IDs
  • Trade-offs: throughput vs. sortability, complexity vs. uniqueness

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.