Rate Card Lookup With Live Credit Score Tier Updates
Last updated: November 29, 2026
Quick Overview
Implement a rate card that maps credit score floors to APRs, supporting adding or updating a tier, removing a tier, and looking up the APR for a score (the tier with the highest floor not above the score).
Upstart
November 29, 20260
0
0 solved
Implement a rate card that maps credit score floors to APRs, supporting adding or updating a tier, removing a tier, and looking up the APR for a score (the tier with the highest floor not above the score).
Pricing at Upstart is model-driven, but partner banks still provide tiered rate grids that pricing logic must clamp to, and those grids change. The interviewer wants an ordered structure with floor lookup and a clear discussion of insert cost versus lookup cost.
What the Interviewer Expects
- Keep floors sorted and map floors to APRs
- Use bisect_right minus one for floor lookup
- Handle updates to an existing floor without duplicating it
- Return None below the lowest tier
- Discuss when a balanced tree or sorted container beats a list
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
- Lookups vastly outnumber updates. Does that change your choice?
- Support a ceiling lookup and a range query of all tiers between two scores.
- How would you version the rate card so in-flight applications keep their old rates?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Operations: set_tier(min_score, apr), remove_tier(min_score), lookup(score). Lookup returns the APR of the largest floor that is less than or equal to the score, or None if the score is below ev...
High-Level Design
Store a sorted Python list of floors plus a dictionary from floor to APR. Lookups are a binary search. Updating an existing floor only changes the dictionary, so we insert into the list only for new f...