Data Structures & AlgorithmsModerateTCS NQT · recursion

Problem: Which operation is the bottleneck of the naive recursive Fibonacci algorithm?

  1. A. Multiplying large integers
  2. B. Reading the input
  3. C. Recomputing the same subproblems exponentially many times
  4. D. Printing the output

Correct answer: C. Recomputing the same subproblems exponentially many times

The call tree repeats subproblems, so memoisation or iteration reduces the cost to linear.

More Coding Interview Problems questions

Exams that ask this topic