Placement AptitudeHardTCS NQT · Capgemini

A staircase has 8 steps. Kavya climbs it taking 1, 2 or 3 steps at a time, in any order. In how many different ways can she reach the top?

  1. A. 34
  2. B. 44
  3. C. 149
  4. D. 81

Correct answer: D. 81

If w(n) is the number of ways for n steps, the last move is 1, 2 or 3 steps, so w(n) = w(n−1) + w(n−2) + w(n−3) with w(0) = 1: 1, 1, 2, 4, 7, 13, 24, 44, 81. 34 allows only 1- and 2-steps (Fibonacci); 44 and 149 are the neighbouring terms read off at the wrong index.

More Permutations, Combinations and Probability (Placement) questions

Exams that ask this topic