Data Structures & AlgorithmsModerateSSC CGL Tier 2 · TCS NQT

Problem: What is the largest power of 2 that divides 480 × 36?

  1. A. 128
  2. B. 7
  3. C. 32
  4. D. 1024

Correct answer: A. 128

480 = 2⁵ · 15 and 36 = 2² · 9, so the product has 2^(5 + 2) = 2⁷ = 128 as its largest power-of-2 divisor. Reporting the exponent gives 7, using only 480's factor gives 32, and multiplying the exponents instead of adding them gives 2¹⁰ = 1024.

More Coding Interview Problems questions

Exams that ask this topic