โ† Cisco questions

Count number of set bits in an integer

Filed under Cisco

Write a function to count the number of set bits (1s) in the binary representation of a given integer. This is also known as the Hamming weight.

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

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