Code RoomDouble-entry accounting atomicity and floors
MediumPrep Room Coding #3237

Double-entry accounting atomicity and floors

System designDatabases & SQLConcurrencyMid–Senior~40 min

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.

Clarify4:30 left
Estimate4:30 planned
Design13:30 planned
Deep dive10:30 planned
Failure7:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.