Server Management
Reported by candidates from Rippling's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Rippling reported this Server Management question in September 2026, and it looks friendlier than it is. You double the capacity on exactly k servers and maximize handled requests. It's a greedy problem with a sort, but one edge case wrecks the obvious approach. If you've got an OA invite for this week, read the trick below. StealthCoder sits invisible on your screen as a safety net if you blank during the live assessment, but you shouldn't need it once this clicks.
The problem
A company has n servers. For server i, serverCapacity[i] is its capacity and incomingRequests[i] is the number of requests arriving at that server. Without an upgrade, server i can handle at most min(serverCapacity[i], incomingRequests[i]) requests. Choose exactly k servers and double their capacities. Return the maximum total number of requests that can be handled across all servers after these upgrades. Function maximumHandledRequests(serverCapacity: int[], incomingRequests: int[], k: int) → long Examples Example 1 serverCapacity = [10,4,3,7] incomingRequests = [3,10,4,5] k = 2 return = 20 Double the capacities of servers 1 and 2, using zero-based indices. The four servers can then handle 3, 8, 4, and 5 requests, for a total of 20. Constraints 1 <= k <= serverCapacity.length <= 2 * 10^5 serverCapacity.length == incomingRequests.length 1 <= serverCapacity[i], incomingRequests[i] <= 10^9
Reported by candidates. Source: FastPrep
Pattern and pitfall
Compute the base total as the sum of min(cap, req) for every server. Doubling server i adds gain = min(2*cap, req) - min(cap, req). That gain is never negative, and it's zero when cap already meets or exceeds req. Compute every gain, sort descending, and add the top k. The edge case: you must upgrade exactly k servers, but since gains are never negative, picking extra zero-gain servers costs nothing. So don't skip them or special-case k larger than the useful servers. The other pitfall is overflow. Values hit 10^9 and n hits 2*10^5, so the sum needs a 64-bit long. Don't greedily pick the smallest capacity or the largest request. Gain is the only thing that matters. Complexity is O(n log n). If you freeze live, StealthCoder can hand you this solution as a hedge.
Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.
You can drill Server Management 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. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Rippling's OA.
Rippling reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Server Management FAQ
What's the trick in the Rippling Server Management problem?+
Compute the marginal gain per server: min(2*cap, req) minus min(cap, req). Sort the gains descending and add the top k to the base sum. Greedy works because each server's upgrade is independent of the others.
How hard is this OA question really?+
Easy to medium. The idea is one sort and a sum. Most failures come from picking servers by capacity or requests instead of gain, or from integer overflow on the total.
Do I need a long for the answer?+
Yes. Each value can reach 10^9 and there can be 2*10^5 servers, so the total can pass 2*10^14. A 32-bit int overflows. The function signature returns long for this reason.
What if k is bigger than the number of servers that benefit?+
Gains are never negative, so extra upgrades add zero. Just take the top k gains from the sorted list, and the zeros contribute nothing. No special case is needed, since k is at most n.
How do I prepare for this in 48 hours?+
Practice the greedy-by-marginal-gain pattern: compute a delta per item, sort, take the top k. Write it once in your language, test with the sample answer of 20, and check your sum type is 64-bit.