Question d’entretien chez Goldman Sachs

Fibonacci implementation

Réponses aux questions d'entretien

Utilisateur anonyme

17 févr. 2012

//Fibonacci Sequence Generation using Recrusion Ex. /* Fib(0) is 0 [base case] * Fib(1) is 1 [base case] * For all integers n > 1: Fib(n) is (Fib(n-1) + Fib(n-2)) [Recursive definition] */ public int GenerateFibonacci(int count) { if (count <= 1) return 1; else return GenerateFibonacci(count - 1) + GenerateFibonacci(count - 2); }

4

Utilisateur anonyme

14 mai 2011

I got the same f-ing question today

1

Utilisateur anonyme

8 juin 2011

Chetan Trikha is a no gooder vice president of Goldman, who has learnt fibonnaci in school and has never used it, and is asking candidates to implement it, whereas nobody can on the fly.

2