← All topics
Quiz: Unique ID Generator: questions with answers
15 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. In a Snowflake ID, why is the timestamp stored in the highest bits?
- Q2. How many IDs can one Snowflake machine create in a single millisecond with a 12-bit sequence?
- Q3. What does this print? (code)
- Q4. What is the main drawback of random UUID v4 as the primary key of a very large, insert-heavy table?
- Q5. Two Snowflake servers were accidentally given the same machine id. What can happen?
- Q6. A generator's clock is moved back 5 ms by NTP. What should a safe Snowflake generator do?
- Q7. What does this print? (code)
- Q8. Why does the ID range (ticket server) approach scale well?
- Q9. Why choose a custom epoch close to your launch date instead of 1970?
- Q10. Which option gives time-sorted IDs that are globally unique, at the cost of 128 bits?
- Q11. Why is MAX(id) + 1 in application code a bad way to create IDs?
- Q12. How many machines can a Snowflake layout with a 10-bit machine id support?
- Q13. What does this print? (code)
- Q14. Snowflake IDs are used directly in public order URLs. What can an outsider learn?
- Q15. In Kubernetes, what is a common trick to give each ID generator a unique machine id?