FastPrepServer Management
Problems/Server Management

Server Management

Rippling logoRippling● EasyNEW GRADINTERNOA
QuestionFunctionExamplesConstraints

Problem statement

Source note: The visible source does not show a callable signature. The judged core task matches the visible source at about 99%.

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 = 2return = 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

More Rippling problems

  • Stateful Log Transform and SearchPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Dependency-Aware Task SchedulerPHONE SCREEN · Seen Nov 2026
  • Filter, Sort, and Deduplicate Scheduled TasksPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
All Rippling interview questionsSee Rippling hiring insights
Saved
class Solution {
    public long maximumHandledRequests(int[] serverCapacity, int[] incomingRequests, int k) {
        // Write your code here.
    }

}
Checking account…