Quote a Remittance With Tiered Fees and Currency Rounding
Last updated: November 29, 2026
Quick Overview
Given a send amount in USD, a fee schedule with amount tiers, an exchange rate, and the receive currency's minor-unit precision, return the fee, the total charged to the sender, and the exact amount the recipient will get.
Remitly
November 29, 20260
0
0 solved
Given a send amount in USD, a fee schedule with amount tiers, an exchange rate, and the receive currency's minor-unit precision, return the fee, the total charged to the sender, and the exact amount the recipient will get.
A warm-up in the style of a Remitly phone screen, where every price shown before a customer taps Send must be exact. The interviewer checks that you avoid floating point for money, pick a deliberate rounding direction, and handle currencies with zero decimal places.
What the Interviewer Expects
- Uses Decimal or integer minor units, never float, for money
- Selects the correct fee tier including boundary amounts
- Rounds the recipient amount in a stated, customer-safe direction
- Handles receive currencies with different minor-unit precision
- Validates non-positive or out-of-range amounts
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 promotional rate that applies only to the first $500 of a first transfer?
- What changes if fees are a percentage plus a fixed component with a cap?
- How do you guarantee the quote shown in the app matches what the ledger books later?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Inputs: send amount as a string (to avoid float parsing errors), fee tiers sorted by inclusive upper bound with a final open tier, a rate of receive units per USD, and the receive currency's number of...
High-Level Design
Parse with Decimal, scan tiers for the first whose bound is at least the amount, compute total, then multiply by the rate and quantize to the receive currency's minor unit with ROUND_DOWN. Return ...