FastPrepMinimum Racks for Server Resources
Problems/Minimum Racks for Server Resources

Minimum Racks for Server Resources

Google logoGoogle● HardFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The interview report keeps the goal of packing server resources. It leaves out the rack power rule, the function signature, and the input limits. Our version is about 85% the same as the reported question.

You are given n indivisible servers. Server i requires bandwidth[i] units of bandwidth and power[i] units of power.

Every rack has a bandwidth capacity of rackBandwidthCapacity and a power capacity of rackPowerCapacity. A group of servers can share one rack only when both of these conditions hold:

  • The sum of their bandwidth requirements is at most rackBandwidthCapacity.
  • The sum of their power requirements is at most rackPowerCapacity.

Assign every server to exactly one rack and return the minimum number of racks required.

Function

minimumRacks(bandwidth: int[], power: int[], rackBandwidthCapacity: int, rackPowerCapacity: int) → int

Examples

Example 1

bandwidth = [4,4,2]power = [3,2,3]rackBandwidthCapacity = 6rackPowerCapacity = 5return = 2

The server with requirements (4, 2) can share a rack with the server requiring (2, 3). Their totals are (6, 5). The remaining server uses a second rack.

Example 2

bandwidth = [3,3,3,3]power = [4,4,4,4]rackBandwidthCapacity = 6rackPowerCapacity = 8return = 2

Each rack can hold exactly two servers, so two racks are sufficient and necessary.

Example 3

bandwidth = [2,2,2]power = [6,6,6]rackBandwidthCapacity = 10rackPowerCapacity = 10return = 3

Bandwidth would allow the servers to share, but any pair needs 12 power units. Each server therefore needs its own rack.

Constraints

  • 1 <= bandwidth.length == power.length <= 15.
  • 1 <= bandwidth[i] <= rackBandwidthCapacity <= 10^6.
  • 1 <= power[i] <= rackPowerCapacity <= 10^6.
  • Every server fits in an otherwise empty rack.

More Google Phone Screen questions

  • Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best Stock Trade with Buy and Sell DaysPHONE SCREEN · Seen Nov 2026
  • Word Chain Jumps in a GridPHONE SCREEN · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Apartment Housemate PreferencesPHONE SCREEN · Seen Nov 2026
  • Price at Query TimestampsPHONE SCREEN · Seen Nov 2026
  • Course Schedule Cycle DetectionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Logger Rate Limiter with Every-Arrival HistoryPHONE SCREEN · Seen Nov 2026

Similar questions at other companies

  • Minimum Cost for a Target WeightPace Stock Broking Services · PHONE SCREEN
  • Optimal Account BalancingAmazon · ONSITE INTERVIEW
  • Delete K Subsets for Maximum ScoreRubrik · OARubrik interview questions
  • Optimize Discount Selection Under a Point BudgetPalantir · OAPalantir interview questions
  • Maximum Index-Weighted Sum with Disjoint SwapsVisa · OAVisa interview questions
  • Distinct OR Values of Increasing SubsequencesScale AI · OAScale AI interview questions
  • Smallest Sufficient TeamExpedia · ONSITE INTERVIEWExpedia interview questions
  • Vehicle Builds for Required Terrain (Game Adaptation)Roblox · OARoblox interview questions
  • Bitwise XOR SubsequencesJP Morgan Chase · OAJP Morgan Chase interview questions
  • Bitwise XOR SubsequencesGoldman Sachs · OAGoldman Sachs interview questions

Google interview experiences

  • Google interviews · November 2026
  • Google Software Engineer Onsite Questions: 10 Experiences
  • Google OA: What It Tests (2026)
  • Google L4 SWE Phone Screen: 1 Experience
  • Google ML Engineering Manager Onsite: 1 Experience
  • Google Experienced SWE First Round and Onsite: 1 Experience
All Google interview questionsSee Google hiring insights
Saved
class Solution {
    public int minimumRacks(int[] bandwidth, int[] power, int rackBandwidthCapacity, int rackPowerCapacity) {
        // Write your code here.
    }
}
Checking account…