🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Unique ID Generator: all 15 questions

Quiz: Unique ID Generator · Question 1 of 15

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

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

  1. A.To make the ID harder to guess
  2. B.So that sorting IDs numerically also sorts them by creation time
  3. C.Because the timestamp is the smallest part
  4. D.To save space
Answer & explanation

Correct answer: So that sorting IDs numerically also sorts them by creation time

The most significant bits dominate the comparison, so a later millisecond always gives a bigger ID.

Can you get the rest right without peeking?

Take the timed Quiz: Unique ID Generator quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →