Design a global timestamp generator
FreeDistributed infrastructureEasy
- Beginner
- System design
- Distributed systems
Quick answer
This distributed infrastructure interview question asks you to design a global timestamp generator. Aim for a design that keeps working across many machines and failures, then explain partitioning, replication, coordination and trade-offs. Interviewers want to see how you reason about failures, consistency and scale.
The problem
Design a distributed timestamp generation system that provides globally unique and monotonically increasing timestamps with low latency.
What must a global timestamp generator do?
- Clients can request a new timestamp.
- The system should generate globally unique timestamps.
- The system should provide monotonically increasing timestamps.
- The system should work across multiple servers and data centers.
- The system should handle clock drift and clock synchronization issues.
- The system should avoid duplicate timestamps after node restarts.
- The system should expose health and clock skew status for operations.
How well must it do it?
- Timestamp generation should be low latency.
- The system should be highly available across regions.
- The system should scale with request volume.
- The system should tolerate node and data center failures.
- The system should avoid central bottlenecks where possible.
- The system should handle backward clock movement safely.
- Ordering guarantees should be clearly defined and predictable.
What scale should you design for?
Use these numbers in your estimates.
| Assumption | Estimate timestamp requests per second from client services |
|---|---|
| Assumption | Peak traffic may be 3x to 10x average traffic |
| Assumption | Estimate node count and data center count before choosing coordination strategy |
| Assumption | Timestamp storage is small if only counters, epochs, and metadata are persisted |
| Assumption | Network latency depends on whether generation is local or globally coordinated |
| Assumption | Stronger global ordering usually increases coordination cost and latency |
Key concepts
- Beginner
- System design
- Distributed systems
- Timestamps
- Clock sync
- Monotonic ordering
How you’ll practise
6 short steps · save and come back any time
- Requirements
- Estimate
- Data model and API
- Partitioning and replication
- Consistency and failures
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any distributed infrastructure design round.
- States the consistency and availability guarantees up front
- Explains partitioning and replication choices
- Describes how nodes agree and recover after failures
- Handles network partitions and slow nodes
- Plans for adding and removing capacity safely
- Names the trade-offs instead of hiding them
Questions people ask about this interview question
- Which design type is this question?
- It is a distributed infrastructure question. You design a global timestamp generator and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Easy, so it suits engineers who are new to distributed infrastructure interviews. It is also a good warm-up before harder questions.
- What should I cover first?
- Start with the guarantees the system must give and the failures it must survive. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- Yes. It is one of the free questions. Sign up to practise it step by step. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team