FastPrepMaximum Subarray
Problems/Maximum Subarray

Maximum Subarray

Squarepoint Capital logoSquarepoint Capital● EasyNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Squarepoint Capital onsite interview. The report names the well-known Maximum Subarray task. It does not give the function signature or the number limits. Our version is about 99% the same as the reported question.

You are given an integer array nums. Find the non-empty contiguous subarray with the largest sum and return that sum.

Function

maxSubArray(nums: int[]) → int

Examples

Example 1

nums = [-2,1,-3,4,-1,2,1,-5,4]return = 6

The best contiguous subarray is [4,-1,2,1], whose sum is 6.

Constraints

  • 1 <= nums.length <= 100000
  • -10000 <= nums[i] <= 10000
  • The answer fits in a signed 32-bit integer.

More Squarepoint Capital interview questions

  • Mutable Record Store with Error ResultsONSITE INTERVIEW · Seen Sep 2026
  • Product of Array Except SelfONSITE INTERVIEW · Seen Aug 2026
  • Estimate Pi with a Finite SeriesONSITE INTERVIEW · Seen Oct 2025
  • In-Memory Directory and File OperationsONSITE INTERVIEW · Seen Oct 2025
  • Count C++ Constructor and Assignment CallsONSITE INTERVIEW · Seen Jun 2025
  • Observe a Lazy GeneratorONSITE INTERVIEW · Seen Feb 2025
  • Order Matching on ExecuteONSITE INTERVIEW · Seen Dec 2024
  • Accumulate Numeric Value ObjectsONSITE INTERVIEW · Seen Sep 2024
  • Differentiate a PolynomialONSITE INTERVIEW · Seen Aug 2023
  • Lazy Filter over a GeneratorPHONE SCREEN · Seen Nov 2026

Similar questions at other companies

  • Best Time to Buy and Sell StockAmazon · ONSITE INTERVIEW
  • Best Time to Buy and Sell StockKotak Mahindra Bank · ONSITE INTERVIEWKotak Mahindra Bank interview questions
  • Best Time to Buy and Sell StockOracle · PHONE SCREEN · ONSITE INTERVIEWOracle interview questions
  • Maximum SubarrayMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Best Time to Buy and Sell StockZoox · ONSITE INTERVIEW
  • Maximum Subarray SumSafe Security · ONSITE INTERVIEW
  • Pascal's TriangleEricsson · ONSITE INTERVIEWEricsson interview questions
  • Best Time to Buy and Sell StockMotive · ONSITE INTERVIEWMotive interview questions
  • Best Time to Buy and Sell StockBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Maximum Profit with Repeated Stock TradesPalantir · ONSITE INTERVIEWPalantir interview questions

Squarepoint Capital interview experiences

  • Squarepoint Capital Data Products First Round: 1 Experience
  • Squarepoint Capital C++ and Python SWE Interviews: 7 Experiences
  • Squarepoint Campus SDE Interviews: 7 Experiences (Part 2 of 2)
  • Squarepoint Capital New Grad SDE OA: 5 Experiences (Part 1 of 2)
All Squarepoint Capital interview questionsSee Squarepoint Capital hiring insights
Saved
class Solution {
    public int maxSubArray(int[] nums) {
      // write your code here
    }
}
Checking account…