Data Structures & AlgorithmsModerateTCS NQT · SSC CGL Tier 2

Problem: What is the largest power of 2 that is less than or equal to 1000?

  1. A. 512
  2. B. 1024
  3. C. 9
  4. D. 256

Correct answer: A. 512

2⁹ = 512 ≤ 1000 < 1024 = 2¹⁰. 1024 overshoots, 9 is the exponent rather than the power, and 256 stops one doubling early.

More Coding Interview Problems questions

Exams that ask this topic