Isolation levels
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.

    Build-up · 5 steps

    Watch a report read half a transfer

    One report, one transfer, two balances. The only thing that changes is when each read takes its snapshot.

    Step 1 of 5

    Two balances, ₹1,000 in all

    Savings and wallet each hold ₹500. Whatever runs alongside it, a correct report must say ₹1,000.

    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

      “A UPI-style wallet debit reads the balance, subtracts ₹200 and writes it back. Two debits can race. What do you do?”

      Your move. Pick an approach:

    2. Deep dive 2 of 4

      Interviewer

      “Month-end reconciliation sums every balance while transfers keep committing. The totals must agree. How do you run it?”

      Your move. Pick an approach:

    3. Deep dive 3 of 4

      Interviewer

      “The hospital needs at least one doctor on call. Asha and Ravi try to sign off at the same moment. What do you do?”

      Your move. Pick an approach:

    4. Deep dive 4 of 4

      Interviewer

      “Tatkal opens. Two bookings each count 71 of 72 confirmed berths in coach S4, then insert one. How do you stop a 73rd?”

      Your move. Pick an approach:

    Build-up · 5 steps

    Write skew, and how SERIALIZABLE stops it

    Snapshot isolation stops two writers of the same row. Write skew slips through because each transaction writes a different one.

    Step 1 of 5

    A rule across two rows

    The hospital needs at least one doctor on call. Asha and Ravi both are, each in their own row of the roster.