Smallest Maximum Exposure When Splitting Loans Across Partners
Last updated: November 29, 2026
Quick Overview
A sequence of loans must be allocated in order to at most k funding partners, each partner taking one contiguous block. Return the smallest possible value of the largest total principal any single partner receives.
Upstart
November 29, 20260
0
0 solved
A sequence of loans must be allocated in order to at most k funding partners, each partner taking one contiguous block. Return the smallest possible value of the largest total principal any single partner receives.
Upstart's marketplace routes originated loans to many lending partners and institutional buyers, and concentration limits matter to every one of them. This onsite problem checks whether you see the monotone feasibility check that enables binary search on the answer, rather than an exponential search over cut points.
What the Interviewer Expects
- Identify the answer range [max(loans), sum(loans)]
- Write a greedy feasibility check for a given cap
- Argue feasibility is monotone in the cap
- Binary search to the smallest feasible cap
- Compare with the O(k n^2) DP
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
- Each partner also has its own maximum. How does the check change?
- Loans do not have to stay in order. Is the problem still easy?
- Return the actual allocation, not just the cap.
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: positive principals in a fixed order and k >= 1. Each partner gets a contiguous block, and a partner may receive nothing only if fewer than k blocks are needed. Output: the minimal possible max...
High-Level Design
Guess a cap C. Greedily walk the loans and start a new block whenever adding the next loan would exceed C. The greedy uses the fewest blocks for that cap because it delays every cut as long as possibl...