Problem statement
Design the object model and core APIs for a double-entry accounting ledger: a chart of accounts, balanced journal entries, and derived balances, built so the books always balance.
Operating context. The ledger holds a chart of accounts, each account having a type (asset, liability, equity, income, expense) and a normal side (debit or credit). A journal entry is a set of debit and credit posting lines that MUST sum to zero to be posted. Posting a balanced entry updates each referenced account's running balance. Posted entries are immutable; a mistake is corrected by an equal-and-opposite reversing entry. The book answers an account's balance as of a date and a trial balance across all accounts, and it supports closing a period. Everything runs in a single process.
Out of scope. Financial-statement presentation (profit-and-loss or balance-sheet formatting), tax, multi-currency consolidation, a persistence layer, user authentication, and any reporting UI.
What to produce. The class hierarchy (Account, JournalEntry, PostingLine, Money value object, Ledger, Period), the public APIs each exposes, how the balanced-entry invariant is enforced at the type or method level, and the entry lifecycle (draft, posted, reversed). Be explicit about how balances stay queryable efficiently rather than by scanning all history, and how immutability preserves a full audit trail.
Requirements
This assessment is a Premium feature.
The statement above is free to read. The functional and non-functional requirements, and the graded canvas that scores your design against them, come with Premium.
Topics
- System Design LLD
- Oop Solid
- Patterns State
- Finance Accounting
- Domain Money