Clocks
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 · 6 min

    Go deeper

    Size it, build it, then make the calls an interviewer will push you on.

    Back of the envelope

    Size it up

    Tap through each step of the arithmetic.

    How far does a server clock drift in one day?

      How long does a Spanner commit wait before anyone may see it?

        Build-up · 6 steps

        Watch version vectors catch a concurrent edit

        Order #4471 in an offline-first field-sales app. The office and a rep with no signal both edit it; the vectors reveal the clash at sync.

        Step 1 of 6

        The office creates the order

        Order #4471 starts on the server with dal. Every version carries one counter per writer, and the server bumps its own entry: [S:1, T:0].

        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

          “Payment and dispatch services both update an order’s status row. Last-write-wins just dropped RIDER_ASSIGNED. What do you change?”

          Node A’s clock runs 80 ms ahead; dispatch wrote 50 ms after reading PAID.

          Your move. Pick an approach:

        2. Deep dive 2 of 4

          Interviewer

          “Your shopping cart accepts writes in two regions, so edits collide. Customers must never lose an add. How do you merge?”

          Your move. Pick an approach:

        3. Deep dive 3 of 4

          Interviewer

          “A ₹1,000 wallet balance is replicated active-active in Mumbai and Chennai. Two debits land at once, one per region. How do you apply them?”

          Your move. Pick an approach:

        4. Deep dive 4 of 4

          Interviewer

          “Your service times out a call with deadline = now() + 5 s. Which clock should now() read?”

          Your move. Pick an approach: