Data Structures & AlgorithmsModerateTCS NQT · Accenture

Problem: Starting from the empty binary string, the value of the string "1011" read in base 2 is computed, then 3 is added. What is the result?

  1. A. 1014
  2. B. 16
  3. C. 11
  4. D. 14

Correct answer: D. 14

1011₂ = 8 + 2 + 1 = 11, plus 3 is 14. Reading the string in base 10 gives 1014, reading it backwards (1101₂ = 13) gives 16, and 11 forgets to add 3.

More Coding Interview Problems questions

Exams that ask this topic