Code RoomContinuous ledger self-consistency
HardPrep Room Coding #3508

Continuous ledger self-consistency

System designDatabases & SQLSenior–Staff~40 min

Design a continuous self-consistency checker for a high-volume double-entry ledger that proves, on an ongoing basis, that the ledger's own invariants hold: every transaction's debits equal its credits, the sum of all balances across each currency is zero (or equals the expected float), and no balance violates its floor. ~30M postings/day. You need to catch a violation within minutes of it being introduced (a bug in a new code path), pinpoint the offending transaction, and do this without locking or scanning the entire ledger every time. How do you build it?

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.