← Amazon questions

Partition Array into Zeros and Ones in One Pass

Filed under Amazon

Given an array containing only zeros and ones, rearrange the elements in-place such that all zeros are on the left and all ones are on the right. The operation must be completed in a single pass.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.