Data Structures & AlgorithmsModerateTCS NQT Digital · Accenture

Problem: The digital root of a positive integer is obtained by repeatedly summing its decimal digits until a single digit remains. What is the digital root of 2^30?

  1. A. 1
  2. B. 2
  3. C. 0
  4. D. 3

Correct answer: A. 1

The digital root equals 1 + (n − 1) mod 9 for positive n, which can be used as a check. Summing the digits only once gives a two-digit intermediate, not the root.

More Coding Interview Problems questions

Exams that ask this topic