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

0

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
Decimal arithmetic
Rounding modes
Minor units
Fee tiers
Input validation
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 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 Problems
Sample 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 ...


Submit Your Answer
Markdown supported

Related Questions