Interview Question

Financial Software Developer Interview

-London, England

Bloomberg L.P.

A rabbit wants to climb some stairs and it can do steps of 1 or 2. How many possible paths are there to follow ( e.g 1-1-1... or 2-2-2 ... or 2-1-2-1... etc)

AnswerAdd Tags

Interview Answers

6 Answers

4

F(n) = F(n-1)+F(n-2)

Amin on

1

Correction on the above: Summation(i=0,floor(n/2))[(n-i)P(i)].

Sid on

0

Summation(i=0,floor(n/2))[(n-i)C(i)] is correct. I need to sleep. Sorry.

Sid on

0

Summation(i=0,floor(n/2))[(n-i)C(i)]. I'm sure this can be further simplified though.

Sid on

3

use recursion

Anonymous on

1

2^n possibility...

Ahmed on

Add Answers or Comments

To comment on this, Sign In or Sign Up.