As reported: Arista Networks software engineer online assessment (2026), coding question 1, "Server Processing Time".
There are numTasks tasks in a row; task i takes processTime[i]. They are assigned to numServer servers so that:
- each server gets a contiguous block of tasks, every task goes to exactly one server;
- each server gets at least
mtasks.
A server's processing time is the sum of its m largest task times. Servers run one after another, so the total processing time is the sum over all servers. Return the maximum possible total.
Example 1
processTime = [1,3,5,2,7,1,5,9], numServer = 3, m = 2 -> 31
Blocks [1,3,5], [2,7], [1,5,9]: (5+3) + (7+2) + (9+5) = 31.
Example 2
processTime = [4,4,4], numServer = 1, m = 3 -> 12
Constraints: 1 ≤ numServer, 1 ≤ m, numServer · m ≤ numTasks ≤ 10^5; 1 ≤ processTime[i] ≤ 10^9.
Code runner format: three lines — processTime (JSON array), numServer, m. Implement maxProcessingTime(processTime, numServer, m); the harness prints the maximum total (it can exceed 32 bits).