← Microsoft questions

Binary Palindrome Set Bits

Filed under Microsoft

Given a positive integer n, determine whether its standard binary representation (without leading zeros) is a palindrome. If it is a palindrome, return the number of set bits (1s) in n; otherwise…

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 Microsoft questions

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