Code Room
System designMediumsd-g114
Subject Double entryLevel Mid–Senior~40 minCommon in Databases & SQL · Concurrency interviewsIndustries Technology

Question

Design the core write path for a double-entry accounting engine backing a neobank. Every money movement creates ≥2 postings that must sum to zero per transaction and per currency, and no account may go below its allowed floor (asset accounts ≥ 0; liability/clearing accounts can be negative). Peak is ~5,000 transactions/sec. Explain how you enforce the balance-to-zero and floor invariants atomically and how you keep it correct under concurrent transfers touching the same accounts.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.

Narrate your design
Loading whiteboard…
Run or narrate your approach, then ask the coach.