FastPrepHash-Based Network Load
Problems/Hash-Based Network Load

Hash-Based Network Load

Rippling logoRippling● EasyNEW GRADOA
QuestionFunctionExamplesConstraints

Problem statement

Source note: The screenshot's selected option is incorrect; the stated hash rule determines the answer. Variable computer count and ordered ties are practice conventions; core source match is about 90%.

A network has computerCount computers numbered from 0 through computerCount - 1. Assign each request to computer requestId % computerCount.

Given the request IDs, return every computer that receives the maximum number of requests, in increasing computer-number order. Each occurrence of an ID is a separate request.

Function

mostLoadedComputers(computerCount: int, requestIds: int[]) → int[]

Examples

Example 1

computerCount = 7requestIds = [17,27,16,5,11,13,9,23,25]return = [2]

Computer 2 receives requests 16, 9, and 23, more than any other computer.

Example 2

computerCount = 3requestIds = [0,1,2,3]return = [0]

Computer 0 receives two requests; the others receive one each.

Example 3

computerCount = 4requestIds = [0,1,4,5]return = [0,1]

Computers 0 and 1 tie with two requests each.

Constraints

  • 1 <= computerCount <= 10^5.
  • 1 <= requestIds.length <= 2 * 10^5.
  • 0 <= requestIds[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
public int[] mostLoadedComputers(int computerCount, int[] requestIds) {
    // Write your code here.
}
Checking account…