Maximize Pipeline Throughput Under a Scaling Budget
Reported by candidates from Microsoft's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Microsoft reported this one in September 2026, and the title sounds like systems design but it's a search problem. You get arrays of throughput and scaling costs, a budget, and you maximize the minimum capacity. If you've seen "maximize the minimum" before, you already know the move: binary search on the answer. The data structure that matters is just a sorted answer range plus a cheap feasibility check over the arrays. No heap, no DP. This is the kind of OA question that feels hard for five minutes and then collapses into twelve lines. Here's the script, plus where people trip.
The problem
You have a serial pipeline of services. Service i has base throughput throughput[i] and one scaling operation costs scalingCost[i]. After scaling service i exactly x times, its capacity is throughput[i] * (x + 1) and the spent budget is x * scalingCost[i]. The pipeline throughput is the minimum capacity among all services. Given a total budget, return the maximum pipeline throughput that can be achieved without exceeding the budget. Function maximizePipelineThroughput(throughput: int[], scalingCost: int[], budget: long) → long Examples Example 1 throughput = [3,2,5] scalingCost = [2,5,10] budget = 28 return = 6 Reaching 6 costs 2 + 10 + 10 = 22. Reaching 7 would cost 4 + 15 + 10 = 29, which exceeds the budget. Example 2 throughput = [5,2,4] scalingCost = [3,10,2] budget = 0 return = 2 With no available scaling operation, the pipeline remains limited by the service whose base throughput is 2. Constraints 1 <= throughput.length = scalingCost.length <= 10^5 1 <= throughput[i] <= 10^7 1 <= scalingCost[i] <= 200 1 <= budget <= 10^9 The answer is at most 10^9.
Reported by candidates. Source: FastPrep
Pattern and pitfall
Binary search on the target throughput T. For each service, if throughput[i] >= T it costs nothing. Otherwise you need x = ceil(T / throughput[i]) - 1 scalings, costing x * scalingCost[i]. Sum those costs and compare to the budget. Feasibility is monotonic: if T works, any smaller T works too. So search from min(throughput) up to 10^9, the stated cap on the answer. Pitfalls: use 64-bit math for the sum, since cost per service can reach about 10^9 * 200 and you sum 10^5 of them. Also bail out early once the running cost passes the budget. Complexity is O(n log 10^9), around 30 passes over 10^5 items. Budget of 0 just returns the minimum base throughput, which example 2 shows. If you blank on the live OA, StealthCoder is the invisible safety net that reads the problem and hands you this structure.
If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.
You can drill Maximize Pipeline Throughput Under a Scaling Budget cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Microsoft's OA.
Microsoft reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Maximize Pipeline Throughput Under a Scaling Budget FAQ
What's the trick in the Microsoft pipeline throughput problem?+
Binary search on the answer. Pick a target throughput T, compute the total scaling cost needed to lift every service to at least T, and check it against the budget. Feasibility is monotonic, so you find the largest T that fits.
How do I compute the cost for one service?+
If throughput[i] is already at least T, cost is zero. Otherwise the scalings needed are ceil(T / throughput[i]) - 1, and you multiply that by scalingCost[i]. Use integer ceiling math like (T + t - 1) / t to avoid floating point errors.
What are the binary search bounds?+
Low is the minimum base throughput, since that's achievable with zero budget. High is 10^9, because the problem says the answer is at most that. Search for the largest T where total cost is within budget, using the upper-mid form to avoid an infinite loop.
Why do overflow bugs show up here?+
Cost for one service can be near 10^9 times 200, and you sum across up to 10^5 services. That blows past 32-bit easily. Use a 64-bit sum, and break early once it exceeds the budget so you never accumulate absurd values.
How do I prep for this in 48 hours?+
Write the binary-search-on-answer template once from memory, then apply it to two or three maximize-the-minimum variants. Focus on the feasibility function and the bounds, not the loop. Test with the budget 0 case from example 2 before you submit.