Layer 3 · Go deeper · 4 min
Go deeper
Size it, build it, then make the calls an interviewer will push you on.
Build-up · 5 steps
Inside a time-ordered ID
Three ID formats, bit by bit. The leading bits decide where each insert lands in a B-tree.
Step 1 of 5
UUIDv4: 122 random bits
Any service can mint one without coordination. But each insert lands on a random leaf page, so the whole index must stay in memory, and splits leave pages part-empty.
4 interview moments
You’re the candidate
The interviewer pushes on the hard parts. Pick an approach and see how it holds up.
Deep dive 1 of 4
Interviewer
“Orders get public IDs, and soon several services will mint them into PostgreSQL. Which primary key do you choose?”
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“In MongoDB, should a user’s orders be embedded in the user’s document?”
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“The product page shows a rating at 17,000 reads a second, and reviews arrive about 6 a second. How do you serve it?”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“On DynamoDB, open orders sit under the GSI key SELLER#7#OPEN. A mega-seller takes 2,000 orders a second. What do you do?”
Your move. Pick an approach: