As reported: Uber SDE-2 backend loop (Bangalore, 2025), round 2 (DSA; an LLD round had been expected): LeetCode Split Array Largest Sum. Starting with DP cost time; with a nudge the binary-search solution was reached and finished. The round was rated medium hire.
This is LeetCode 410 — Split Array Largest Sum.
Split nums into m non-empty contiguous subarrays so that the largest subarray sum is minimized. Return that minimized largest sum.
Example 1
nums = [7,2,5,10,8], m = 2
Output: 18 ([7,2,5] and [10,8])
Example 2
nums = [1,2,3,4,5], m = 2
Output: 9
Constraints: 1 ≤ nums.length ≤ 1000; 0 ≤ nums[i] ≤ 10^6; 1 ≤ m ≤ min(50, nums.length).
Code runner format: one JSON value per line: nums, m (LeetCode's test-case format). Implement splitArray(nums, m); the harness prints the sum.