Data modeling
0-day streakReview

Your progress

Level 1

0 XP100 XP to level 2
0day streak
0best streak
0topics started
0cards reviewed
    Review cards

    Progress is stored only in this browser. No account is required.

    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.

    1. 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:

    2. 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:

    3. 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:

    4. 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: