Move zeros to front
Company: Uber
Role: Data Scientist
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Quick Answer: This question evaluates array manipulation and in-place algorithm skills, specifically competency in stable element reordering, index management, and space/time complexity considerations within the Coding & Algorithms domain.
Examples
Input: ([1, 0, 2, 0, 3],)
Expected Output: [0, 0, 1, 2, 3]
Explanation: Prompt example.
Input: ([0, 1, 0],)
Expected Output: [0, 0, 1]
Explanation: Zeros already partly front.
Input: ([1, 2],)
Expected Output: [1, 2]
Explanation: No zeros.
Input: ([],)
Expected Output: []
Explanation: Empty array.