Leetcode 283. Move Zeroes
Rearrange the array in-place so all zeros are moved to the end while preserving the relative order of non-zero elements, without using extra storage. Aim to minimize the number of writes/operations (stable partition / two-pointer pattern).
Asked at:
Microsoft
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early April, 2026
Microsoft
Senior
Late October, 2025
Microsoft
Mid-level
Late January, 2025
Meta
Senior
Q1) https://leetcode.com/problems/move-zeroes/description/ Followup: a) Move all zeros to the start of the array while maintaining the relative order of other numbers. b) Move all zeros to the start, negative numbers to the middle, and positive numbers to the end. The order within negative elements can be out of order. And the same for positive elements. This is similar to the Leetcode sort colors problem.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.