FastPrepServer Selection
Problems/Server Selection

Server Selection

Point72 logoPoint72● MediumINTERNNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Point72 online assessment for interns and new grads. The image in the report hides parts of the goal, the notes, the examples, and the number limits. This version makes it clear that you pick the smallest count and use each server once. We added how zero load behaves, limits, examples, and a function interface. Our version is about 85% the same as the image and its explanation.

You are given an array server, where server[i] is the request-handling capacity of one server. Every capacity is a power of 2. You are also given a target load expected_load.

Return the minimum number of servers whose capacities sum to exactly expected_load. Return -1 if no such selection exists.

For this exercise, assume the following selection rules:

  • Each array element represents a separate server that may be selected at most once. Servers with equal capacities remain separate choices.
  • A selected server contributes its entire capacity; capacities cannot be split or partially used. A total greater than expected_load is not valid.
  • If expected_load is 0, the empty selection is valid and the answer is 0.

The callable minimumServers(server, expected_load) returns only the minimum count, not the selected indices. The target uses a long integer in Java and a long long integer in C++.

Function

minimumServers(server: int[], expected_load: long) → int

Examples

Example 1

server = [1,2,8,4,2]expected_load = 13return = 3

Select capacities 8, 4, and 1, totaling 13. The two largest servers total only 12, so fewer than three cannot work.

Example 2

server = [2,2,8]expected_load = 7return = -1

Every possible total is even, so no selection totals 7. The server with capacity 8 cannot be used partially.

Example 3

server = [16,8,4]expected_load = 0return = 0

Select no servers to meet the zero load.

Constraints

  • 1 <= server.length <= 100000.
  • For this exercise, assume server[i] = 2^b for an integer b with 0 <= b <= 30.
  • For this exercise, assume 0 <= expected_load <= 10^15.

More Point72 interview questions

  • Maximize Array Beauty After DeletionsOA · Seen Aug 2026
  • Simulate a Deterministic Finite AutomatonOA · Seen Aug 2026
  • Initial Public OfferingOA · Seen Jul 2026
  • Test the HypothesisOA · Seen Jul 2026
  • Get Triplet CountOA · Seen Jul 2026
  • Internet Service Provider Monthly ReportOA · Seen Jul 2026
  • Lexicographically Smallest String After Substring OperationOA · Seen May 2026
  • Best Time to Buy and Sell Stock IIPHONE SCREEN · Seen Aug 2026
  • Find Minimum in a Rotated Sorted ArrayPHONE SCREEN · Seen Aug 2026
  • Generate an Optimal Portfolio Trading ReportPHONE SCREEN · Seen Apr 2026

Similar questions at other companies

  • Minimize the Maximum Array ElementChubb · OAChubb interview questions
  • Minimum Halvings for Alternating ParityIBM · OAIBM interview questions
  • Minimum Servers for an Exact LoadJP Morgan Chase · OAJP Morgan Chase interview questions
  • Get Max Or SumMicrosoft · OAMicrosoft interview questions
  • Maximize PartitionsAmazon · OA
  • Fewest Steps to Build an Array from ZerosExpedia · OAExpedia interview questions
  • Maximum XOR Elimination ScoreRippling · OARippling interview questions
  • Minimum Cost for a Target WeightPace Stock Broking Services · PHONE SCREEN
  • Minimum Row Deletions to Prevent a Target ORInMobi · ONSITE INTERVIEWInMobi interview questions
  • Earn the Most 🐝Capital One · OACapital One interview questions
All Point72 interview questionsSee Point72 hiring insights
Saved
class Solution {
    public int minimumServers(int[] server, long expected_load) {
        // Write your code here.
    }
}
Checking account…