FastPrepSplit Array Largest Sum
Problems/Split Array Largest Sum

Split Array Largest Sum

AuxoAI logoAuxoAI● HardFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: This was one of four coding questions in an AuxoAI online assessment for an AI Engineer role. You cut the array into exactly k non-empty blocks in order, and make the biggest block sum as small as possible.

The post gives no limits and no examples. Here, the array has up to 1,000 numbers from 0 to 10^6, and k is at most 50.

Our version is about 95% the same as the reported question.

You are given an integer array nums and an integer k.

Split nums into exactly k parts. Each part must be a non-empty block of neighboring elements, and every element must belong to exactly one part. The parts keep the original order of the array.

The largest sum of a split is the biggest sum among its k parts. Return the smallest largest sum you can get.

Function

splitArray(nums: int[], k: int) → int

Examples

Example 1

nums = [3,1,4,1,5]k = 2return = 8

There are four ways to split into 2 parts:

  • [3] [1,4,1,5]: sums 3 and 11, largest 11.
  • [3,1] [4,1,5]: sums 4 and 10, largest 10.
  • [3,1,4] [1,5]: sums 8 and 6, largest 8.
  • [3,1,4,1] [5]: sums 9 and 5, largest 9.

The smallest of these is 8.

Example 2

nums = [1,2,3]k = 1return = 6

With k = 1, the whole array is one part, and its sum is 1 + 2 + 3 = 6.

Example 3

nums = [0,5,0]k = 3return = 5

With k = 3, each element is its own part: [0] [5] [0]. The largest sum is 5.

Constraints

  • 1 <= nums.length <= 1000
  • 0 <= nums[i] <= 10^6
  • 1 <= k <= min(50, nums.length)

More AuxoAI Online Assessment questions

  • Count Valid Square PairsOA · Seen Nov 2026
  • Largest Consistent Visiting GroupOA · Seen Nov 2026
  • Sliding Window MedianOA · Seen Nov 2026

Similar questions at other companies

  • Split Array to Minimize the Largest SumInfosys · OAInfosys interview questions
  • Split Array to Minimize the Largest SumNation with NaMo · PHONE SCREEN
  • Minimize the Largest Part BeautyAdobe · PHONE SCREENAdobe interview questions
  • Split Array Largest SumBloomberg LP · ONSITE INTERVIEWBloomberg LP interview questions
  • Maximum Non-Decreasing Array LengthVisa · OAVisa interview questions
  • Get Minimum IncrementIBM · OAIBM interview questions
  • Maximize Array Beauty After DeletionsPoint72 · OAPoint72 interview questions
  • Data ReorganizationGoldman Sachs · OAGoldman Sachs interview questions
  • Min Elements to Remove to Make Almost Sorted ArraySalesforce · OASalesforce interview questions
  • Find Optimal LevelAmazon · OA
See AuxoAI hiring insights
Saved
class Solution {
    public int splitArray(int[] nums, int k) {
        // Write your code here.
    }
}
Checking account…