Design: Simplify Debts Algorithm System
Design focuses on the algorithm and system to simplify debts. UI, authentication, and persistent storage are out of scope.
Functional Requirements
FR1: Accept a list of debts between multiple people (who owes whom and how much).
FR2: Calculate the minimum number of transactions required to settle all debts.
FR3: Output the simplified set of transactions that clears all debts.
FR4: Support up to 1000 people and 10,000 debt records.
FR5: Provide results within 1 second for the maximum input size.
Non-Functional Requirements
NFR1: Algorithm must be efficient to handle large inputs.
NFR2: Memory usage should be optimized for up to 1000 people.
NFR3: System should be reliable and produce consistent results.
NFR4: Latency target: p99 < 1 second for processing debts.