Represent Money Safely for Multi-Currency Statements
Last updated: November 29, 2026
Quick Overview
Explain why binary floating point is a poor choice for card balances and statement amounts, and show how you would represent money and split an amount (for example, a shared fee or an installment plan) into parts that always add back to the exact total across currencies with different minor units.
American Express
November 29, 20260
0
0 solved
Explain why binary floating point is a poor choice for card balances and statement amounts, and show how you would represent money and split an amount (for example, a shared fee or an installment plan) into parts that always add back to the exact total across currencies with different minor units.
American Express bills in many currencies and builds features such as installment plans that split purchases into equal payments. The interviewer checks that you understand float rounding, minor units per currency and deterministic allocation, which are everyday concerns in payments code.
What the Interviewer Expects
- Shows a concrete float error like 0.1 + 0.2
- Stores amounts as integer minor units with a currency code
- Knows currencies differ in decimal places (JPY 0, USD 2, KWD 3)
- Allocates remainders so parts sum exactly to the total
- Names a rounding mode and where conversion happens
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- How would you convert between currencies while keeping auditability?
- Which rounding mode would you pick for interest calculations and why?
- How would you serialize money in a JSON API between Java, Go and JavaScript services?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
We need a money representation that adds, compares and serializes exactly, respects each currency's minor units, and an allocate that splits an amount by weights (equal installments, or 50/30/20) wi...
High-Level Design
Binary floats cannot represent most decimal fractions: 0.1 + 0.2 == 0.3 is false, and errors compound across millions of statement lines. Represent money as (amount_minor: int, currency: str), par...