FastPrepDifferentiate a Polynomial
Problems/Differentiate a Polynomial

Differentiate a Polynomial

Squarepoint Capital logoSquarepoint Capital● EasyNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Squarepoint Capital new-grad onsite interview. The report asks for polynomial differentiation with edge cases, but gives no representation or code. We chose a coefficient array, the order, how zero is written, the examples and the limits. The exact interview date is unknown. Our version is about 50% the same as the reported question.

Return the formal derivative of the polynomial described by coefficients.

For this exercise, assume the coefficient at index i multiplies x^i. Coefficients are integers and powers are nonnegative integers. For example, [5, 3, 2] represents 5 + 3x + 2x^2.

Return coefficients in the same ascending-power order. Remove trailing zero coefficients from the result, but return [0] for the zero polynomial. The input may contain trailing zeros. The derivative of a constant is zero.

Function

differentiatePolynomial(coefficients: int[]) → int[]

Examples

Example 1

coefficients = [5, 3, 2]return = [3, 4]

The derivative of 5 + 3x + 2x^2 is 3 + 4x, so the result is [3, 4].

Example 2

coefficients = [4]return = [0]

A constant has derivative zero. Its canonical coefficient array is [0].

Example 3

coefficients = [1, 0, 0, -2]return = [0, 0, -6]

The constant disappears and -2x^3 becomes -6x^2. The zero coefficients keep the missing constant and x terms in their correct positions.

Constraints

  • 1 <= coefficients.length <= 2000
  • -100000 <= coefficients[i] <= 100000
  • Every input coefficient is an integer.

More Squarepoint Capital interview questions

  • Mutable Record Store with Error ResultsONSITE INTERVIEW · Seen Sep 2026
  • Maximum SubarrayONSITE INTERVIEW · Seen Aug 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
  • Newton Square Root to a Guaranteed TolerancePHONE SCREEN · Seen Nov 2026

Similar questions at other companies

  • Plus OneDruva · ONSITE INTERVIEW
  • Rotate a Flat Image ClockwiseGoogle · ONSITE INTERVIEWGoogle interview questions
  • Matrix MultiplicationeBay · ONSITE INTERVIEWeBay interview questions
  • Maximum Product of Three IntegersPelatro · ONSITE INTERVIEW
  • Exact-Sixty Dice Game ValueJane Street · ONSITE INTERVIEWJane Street interview questions
  • Find the Missing Number from 1 to nHyperVerge · ONSITE INTERVIEW
  • Alternating Index Square SumAccenture · ONSITE INTERVIEWAccenture interview questions
  • Moving Cost by Volume and CategoryWayfair · ONSITE INTERVIEWWayfair interview questions
  • Add One to a Number Represented as DigitsOracle · ONSITE INTERVIEWOracle interview questions
  • Streaming Entropy, Part 1: Batch EntropyOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions

Interview reports that mention this question

  • Squarepoint Campus SDE Interviews: 7 Experiences (Part 2 of 2)

Squarepoint Capital interview experiences

  • Squarepoint Capital C++ and Python SWE Interviews: 7 Experiences
  • 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[] differentiatePolynomial(int[] coefficients) {
        // write your code here
    }
}
Checking account…