FastPrepProduct of Array Except Self
Problems/Product of Array Except Self

Product of Array Except Self

Squarepoint Capital logoSquarepoint Capital● MediumNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

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

Given an integer array nums, return an array answer where answer[i] is the product of every element of nums except nums[i].

Build the result without using division and in linear time.

Function

productExceptSelf(nums: int[]) → int[]

Examples

Example 1

nums = [1,2,3,4]return = [24,12,8,6]

Each position contains the product of all values except the one at that position.

Example 2

nums = [-1,1,0,-3,3]return = [0,0,9,0,0]

Only the index containing 0 receives the product of all nonzero values.

Constraints

  • 2 <= nums.length <= 100000
  • -30 <= nums[i] <= 30
  • Every prefix product and suffix product fits in a signed 32-bit integer.
  • Do not use division.
  • Your algorithm must run in O(n) time.

More Squarepoint Capital interview questions

  • Mutable Record Store with Error ResultsONSITE INTERVIEW · Seen Sep 2026
  • Maximum SubarrayONSITE 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

  • Subarray Sum Equals KServiceNow · ONSITE INTERVIEWServiceNow interview questions
  • Count Subarrays with Equal Even and Odd CountsMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Range Booking TotalsGoogle · ONSITE INTERVIEWGoogle interview questions
  • Product of Array Except SelfWalmart Labs · ONSITE INTERVIEW
  • Subarrays Whose Sum Is a Power of TwoKotak Mahindra Bank · ONSITE INTERVIEWKotak Mahindra Bank interview questions
  • Maximize Compatible Car RidersUber Freight · PHONE SCREEN · ONSITE INTERVIEWUber Freight interview questions
  • Count Subarrays with Sum KMakeMyTrip.com · ONSITE INTERVIEWMakeMyTrip.com interview questions
  • Product Of Array Except SelfInfosys · ONSITE INTERVIEWInfosys interview questions
  • Centered K-by-K Submatrix SumsCitadel · ONSITE INTERVIEWCitadel interview questions
  • Farthest Affordable Shop per QueryAdobe · ONSITE INTERVIEWAdobe 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[] productExceptSelf(int[] nums) {
      // write your code here
    }
}
Checking account…