FastPrepGPU Capacity With Limited Cluster Switching
Problems/GPU Capacity With Limited Cluster Switching

GPU Capacity With Limited Cluster Switching

Mistral AI logoMistral AI● HardFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A firsthand Mistral AI CodeSignal report dated April 16, 2026 describes remaining GPU capacity, a daily reset, and unlimited switching. The final part is dynamic programming with at most K cluster switches. We chose the sparse row encoding and an exact return value that does not depend on ties. We kept the main algorithm from the report.

You operate several GPU clusters for a sequence of days. Cluster c has a fixed capacity capacities[c]. Each row [day, cluster, used] records the GPUs already occupied on that day; an omitted pair has zero usage.

Choose exactly one cluster per day. Its contribution is capacity - used. Moving from one cluster to a different cluster between consecutive days consumes one switch. Return the maximum total remaining GPU capacity obtainable with at most maxSwitches switches.

Every day and cluster pair appears at most once in usages.

Function

maximizeRemainingGpu(capacities: int[], numDays: int, usages: int[][], maxSwitches: int) → int

Examples

Example 1

capacities = [10,8]numDays = 3usages = [[0,0,9],[0,1,1],[1,0,0],[1,1,7],[2,0,9],[2,1,0]]maxSwitches = 1return = 19

Use cluster 1 on day 0, switch to cluster 0 on day 1, and remain there on day 2 for 7 + 10 + 1 = 18.

Example 2

capacities = [5,9]numDays = 2usages = []maxSwitches = 0return = 18

With no switches, staying on cluster 1 contributes 9 on each day.

Constraints

  • 1 <= capacities.length <= 50
  • 1 <= numDays <= 200
  • 0 <= maxSwitches < numDays
  • 0 <= used <= capacities[cluster] <= 10000

Similar questions at other companies

  • Split Array to Minimize the Largest SumInfosys · OAInfosys interview questions
  • Largest Consistent Visiting GroupAuxoAI · OA
  • 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
  • Maximum Sum of HeightsVirtu Financial · OAVirtu Financial interview questions
  • Pressure-Isolation Shutdown OrderIntuit · OAIntuit interview questions
  • Get Minimum IncrementIBM · OAIBM interview questions
  • Jump Game with Prime-3 StepsUber · OAUber interview questions
  • Maximum Payout with Context SwitchesPhonePe · OAPhonePe interview questions
See Mistral AI hiring insights
Saved
class Solution {
    public int maximizeRemainingGpu(int[] capacities, int numDays, int[][] usages, int maxSwitches) {
      // Write your code here.
    }

}
Checking account…