← Flipster Interview Insights

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

Senior
Apr 2026

Summary

Flipster system design round, pretty deep dive into distributed ID generation. The kind of question that sounds straightforward until you're 20 minutes in and someone asks about clock rollback.

Questions Asked (1)

Q1

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

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

I started with the Snowflake-style layout pretty confidently: timestamp in the high bits, machine/shard ID in the middle, sequence counter at the tail.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: 64-bit IDs, high throughput, multi-node, sortable, and fault-tolerant. Then propose a Snowflake-like layout with timestamp, machine ID, and sequence, and discuss trade-offs and failure handling.

Pro tip: Emphasize that clock rollback is the hardest problem; propose a hybrid approach using a monotonic clock or waiting until the clock catches up, and consider using a coordination service like ZooKeeper for machine ID assignment.

1. Clarify Requirements and Constraints

Ask about throughput, latency, sortability, and failure tolerance to tailor the design.

2. Design Bit Layout

Allocate bits for timestamp, machine ID, and sequence number, ensuring 64-bit total and sortability.

3. Address Collision Avoidance and Sharding

Use unique machine IDs per node and sequence numbers to avoid collisions; discuss sharding strategies for scaling.

4. Handle Clock Skew and Rollback

Implement mechanisms like clock drift monitoring, waiting, or using logical clocks to handle rollback.

5. Discuss Failure Scenarios and Mitigations

Cover duplicate machine IDs, clock rollback, and node failures, and propose solutions like ID leasing or fallback modes.

Key Points to Mention

  • Bit layout: 41-bit timestamp, 10-bit machine ID, 12-bit sequence (or similar), with epoch customization.
  • Collision avoidance: unique machine IDs assigned via coordination service, sequence numbers per millisecond.
  • Clock skew: use NTP, monitor drift, and handle rollback by waiting or using a monotonic clock.
  • Sharding: partition ID space by machine ID or timestamp ranges for scalability.
  • Sortability: timestamp as most significant bits ensures roughly time-ordered IDs.
  • Failure scenarios: duplicate machine IDs (use leases), clock rollback (wait or fail), and node failures (redundancy).

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