Square a Sorted Array in Linear Time
Company: Instacart
Role: Machine Learning Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Overview: Produce sorted squares from a sorted integer array using two pointers. Explain endpoint selection, duplicate preservation, the loop invariant, and why the algorithm runs in linear time.
Read the full Instacart Machine Learning Engineer interview experience this question came from