FastPrepSquares of a Sorted Array
Problems/Squares of a Sorted Array

Squares of a Sorted Array

Stryker logoStryker● EasyPHONE SCREEN

Updated Sep 2026

QuestionFunctionExamples

Problem statement

Source note: This problem is backed by a real Stryker phone-screen interview report. The report included the exact sample input for the sorted-squares task, but it did not include the exact interface, expected sample output, or constraints. The core task match is about 95%.

Given an integer array nums sorted in nondecreasing order, square every value and return the resulting values in nondecreasing order.

Function

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

Examples

Example 1

nums = [-4,-1,0,3,10]return = [0,1,9,16,100]

Example 2

nums = [-7,-3,2,3,11]return = [4,9,9,49,121]

Similar questions at other companies

  • Squares of a Sorted ArrayInstacart · PHONE SCREENInstacart interview questions
  • Merge Two Sorted ArraysCapgemini · PHONE SCREENCapgemini interview questions
  • Squares of a Sorted ArrayGoldman Sachs · PHONE SCREENGoldman Sachs interview questions
  • Merge Into the Zero-Padded ArrayAdobe · PHONE SCREENAdobe interview questions
  • Three Partition ArrayMicrosoft · PHONE SCREENMicrosoft interview questions
  • Sorted Squares in Descending OrderWhatNot · PHONE SCREENWhatNot interview questions
  • Assign CookiesExpedia · PHONE SCREEN · ONSITE INTERVIEWExpedia interview questions
  • Merge Sorted Arrays with DuplicatesMygate · PHONE SCREENMygate interview questions
  • 3SumAmazon · PHONE SCREEN
  • Sort Ones, Twos, and Threes In PlaceAgoda · PHONE SCREEN · ONSITE INTERVIEWAgoda interview questions
See Stryker hiring insights
Saved
class Solution {
    public int[] sortedSquares(int[] nums) {
      // write your code here
    }
}
Checking account…