Apply Guaranteed Rate Windows When Transfers Are Funded Late
Last updated: November 29, 2026
Quick Overview
Each quote locks a rate for a validity window. Given quotes, a time series of live rates and a list of funding events, return the rate actually applied to each transfer: the locked rate if funded inside the window, otherwise the latest live rate at funding time.
Wise
November 29, 20260
0
0 solved
Each quote locks a rate for a validity window. Given quotes, a time series of live rates and a list of funding events, return the rate actually applied to each transfer: the locked rate if funded inside the window, otherwise the latest live rate at funding time.
Wise guarantees the exchange rate for a set period after a quote, and customers who pay by slow bank transfer sometimes fund after it expires. The screen checks careful interval boundaries and binary search over a sorted rate history.
What the Interviewer Expects
- Defines the window as half-open [created, created + valid) and says so
- Uses binary search for the latest rate at or before a timestamp
- Returns whether the guarantee applied, not just the rate
- Handles funding before the first known rate
- Tests the exact expiry boundary
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
- Should the guarantee use the time the money left the customer's bank or the time Wise received it?
- How would you serve this for millions of transfers per day with rates updating every second?
- If the market moves against Wise inside the window, who bears the cost and how would you hedge?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Quotes map id to (rate, created_at, valid_seconds). Live rates are a list of (timestamp, rate) sorted by time. For each funding (quote_id, funded_at) return (quote_id, rate, guaranteed). I will treat ...
High-Level Design
Inside the window, use the locked rate. Otherwise find the last live rate with timestamp at or before funded_at using bisect_right minus one. Precompute the timestamp list once....