Skills101
← All practice quizzes

Quiz: Unique ID Generator

5 questions · new set on every retakeNo time limitPass: 60%+10 XP on first pass

How do hundreds of servers create IDs that never clash, without asking each other? Compare auto-increment, UUIDs and ID ranges, then build and decode a Twitter-style Snowflake ID in Python.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    In a Snowflake ID, why is the timestamp stored in the highest bits?

  2. Question 2

    How many IDs can one Snowflake machine create in a single millisecond with a 12-bit sequence?

  3. Question 3

    What does this print?

    ts, machine, seq = 5, 3, 2
    i = (ts << 22) | (machine << 12) | seq
    print(i >> 22, (i >> 12) & 1023, i & 4095)
    
  4. Question 4

    What is the main drawback of random UUID v4 as the primary key of a very large, insert-heavy table?

  5. Question 5

    Two Snowflake servers were accidentally given the same machine id. What can happen?

🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →