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
Coding & Algorithms
Software Engineer
Wise
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

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
minor units
Decimal arithmetic
rounding modes
currency exponents
fee calculation
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample 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...


Submit Your Answer
Markdown supported

Related Questions