Fix the Bugs in a Loan Ledger

Asked at Amazon · Coding Questions · Difficulty: Medium · Last asked Jun 30, 2026

A small in-memory lending service keeps a ledger of balances and peer-to-peer loans. The starter code contains a `LoanLedger` class that is supposed to follow the rules below, but it has several defects. Debug it and fix it so that every rule holds.

Loading the problem…