← Microsoft questions
CodingReported in a candidate post, Aug 2020

Set bits in an integer

Filed under Microsoft

Given a 32-bit integer, find the total number of set bits (population count), and determine the positions of the first (lowest-order) and last (highest-order) set bit.

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.