Meta interview question

The recruiter asked me to code a function that returns the Fibonacci sequence.

Interview Answers

Anonymous

26 Mar 2017

I would write only the function and I assume that you will have to return the array: It goes as follows: long[] fib(int n){ long[] result= new long[n]; result[0]=0; result[1]=1; if(n<2) return result; for(int i=0;i

1

Anonymous

16 Mar 2015

I did so with iteration but they told me my solution wasn't as efficient as the other contenders, so I was rejected.