Quote a Transfer Across Currencies With Different Minor Units
Last updated: November 29, 2026
Quick Overview
Given a send amount in minor units, a mid-market rate, a percentage fee and a fixed fee, compute the fee, the amount converted and the amount the recipient gets, rounding correctly for currencies with 0, 2 or 3 decimal places (JPY, GBP, BHD).
Wise
November 29, 20260
0
0 solved
Given a send amount in minor units, a mid-market rate, a percentage fee and a fixed fee, compute the fee, the amount converted and the amount the recipient gets, rounding correctly for currencies with 0, 2 or 3 decimal places (JPY, GBP, BHD).
Every Wise transfer starts with a quote that shows the fee and the exact recipient amount upfront, so off-by-one-minor-unit errors are visible to customers and break reconciliation. A phone screen uses this to check whether a candidate avoids floats for money, knows that currencies have different exponents, and picks rounding rules deliberately.
What the Interviewer Expects
- Represents money as integer minor units or Decimal, never binary floats
- Looks up the currency exponent instead of assuming two decimals
- Takes the fee from the source amount before conversion and states the rounding policy for fee and payout
- Rejects amounts that do not cover the fee
- Traces one example by hand, including a zero-decimal currency
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you support a 'recipient gets exactly X' quote, solving backwards for the send amount?
- Why might the fee round half up while the payout uses banker's rounding?
- How do you guarantee the backend and the mobile app show the identical number?
- What changes if a currency's exponent changes (for example a redenomination)?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: send amount in source minor units (pence, cents), source and target currency codes, a rate as a decimal string, a percentage fee and a fixed fee in source minor units. Output: fee in source min...
High-Level Design
Keep a table of ISO 4217 exponents (JPY 0, GBP 2, BHD 3). Convert minor units to Decimal with scaleb(-exponent), compute in Decimal, and quantize back to the currency's smallest step. The fee is...