Code Room
On-callMediumoc-g433
Subject Lock contentionLevel Mid–Senior~30 minCommon in Concurrency interviewsIndustries Technology, Software development

Question

Since this morning's deploy, a small but steady stream of requests on the 'transfer between accounts' endpoint fail with `ERROR: deadlock detected`, and the error rate scales with concurrency — it's worst at peak. The transfer logic debits one account and credits another within a single transaction, updating two `accounts` rows. Before the deploy there were essentially no deadlocks. The DB is otherwise healthy. Triage and mitigate.

What a strong answer looks like

Stop the bleeding first (mitigate), then form hypotheses from real signals. Separate root cause from symptom, communicate status as you go, and close with what prevents a repeat.

Diagram & narrate the incident
Loading whiteboard…
Run or narrate your approach, then ask the coach.