Effectively-once
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

    One redelivery, with and without a dedupe row

    Message m7 debits ₹499 from a ₹1,000 balance. The worker crashes after committing but before acking, so m7 comes back.

    Step 1 of 5

    The first delivery

    Delivery 1 debits ₹499 and commits, taking the balance from ₹1,000 to ₹501.

    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 wallet-debit consumer must survive redeliveries, including two consumers holding one message at once. Where does the dedupe check live?”

      Your move. Pick an approach:

    2. Deep dive 2 of 4

      Interviewer

      “Some handlers take a minute, and one bad message keeps blocking a Kafka partition. Processed-messages table or inbox?”

      Your move. Pick an approach:

    3. Deep dive 3 of 4

      Interviewer

      “You partition processed_messages by day so old keys drop cheaply. Which date do you partition by?”

      Your move. Pick an approach:

    4. Deep dive 4 of 4

      Interviewer

      “A refund consumer calls Stripe. How do you stop a redelivery from refunding twice?”

      Your move. Pick an approach:

    Build-up · 5 steps

    Follow event e-91 end to end

    A ₹1,200 UPI payment earns 2% cashback, ₹24. Duplicates are born at every hop; they die only where something checks a key.

    Step 1 of 5

    Committed with an outbox row

    Payments commits pay_42 as SUCCESS and an outbox row PaymentSucceeded, event e-91, in one transaction. Nothing can be lost from here.