Module 5 · Interview Prep: A P2P Wallet and Ledger Lesson 32 of 54

Two Spends at Once, and a Deadlock

Never below zero under pressure, and locking accounts in a fixed order.

2:04 clip1:09:24–1:11:28 in the full courseWatch on YouTube

Transcript

28 sentences · select one to jump there

Check your understanding

Sara (account 17) sends Omar (account 42) $50 while Omar sends Sara $20. How do you avoid a deadlock?

Choose one answer

Lesson notes

The rule

Check and debit in one locked step, and always lock accounts smallest ID first