← Amazon questions

Binary complement of a number

Filed under Amazon

Given a non-negative integer, calculate its binary complement. The complement is formed by flipping all the bits in its binary representation (changing 0s to 1s and 1s to 0s) and returning the…

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.