Code Room
System designHardsd-g390
Subject ReconciliationLevel Senior–Staff~40 minCommon in Databases & SQL interviewsIndustries Technology, Software development

Question

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.

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