Data Structures & AlgorithmsModerateTCS NQT · CAT

Problem: What is the value of the lowest set bit of 96 (the largest power of 2 dividing 96)?

  1. A. 64
  2. B. 3
  3. C. 32
  4. D. 5

Correct answer: C. 32

96 = 1100000₂, and 96 & −96 keeps only the lowest 1, which is 32. n & (n − 1) clears that bit and leaves 64, 3 is the odd part, and 5 is the bit's index, not its value.

More Coding Interview Problems questions

Exams that ask this topic