โ† Amazon questions

Rightmost set bit

Filed under Amazon

Write a function to find the position of the rightmost set bit (1) in the binary representation of a given integer. Return the 1-based index of the bit, or 0 if the number is 0.

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.