Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Fibs interview question

Name: Anonymous 2020-04-22 15:51

Amazingly, I had a technical interview yesterday via webex, which featured a question for calculating the nth term of fibs in a curly-bracket language. Being both an ENTERPRISE CUDDER and a long-time prog-rider and who has implemented fibs is a number of both popular and esoteric languages (including some of my own creation), this was an easy task , and I rattled off a solution as follows:

int Fibonacci(int n)
{
switch(n)
{
case 0:
throw new InvalidFibonacciTermException();
case 1:
case 2:
return 1;
default:
return Fibonacci(n-1) + Fibonacci(n-2);
}
}


Afterwards we discussed that the flaws of this approach, and alternate solutions (where I described a standard iterative solution). I was then probed for a further 90 minutes on various topics.

Today I found out that my application won't be progressing further, and one piece of feedback was that my fibs looked like it had been googled. It seems like my fibs-fu was too strong for these plebs!

Name: Anonymous 2020-04-23 9:26

>>12
Hmm, I calculate it as follows:
01:11
02:11
03:22
04:33
05:55
06:88
07:143
08:231
09:374
10:605
11:979
12:1584
13:2563
14:4147
15:6710
16:10857
17:17567
18:28424
19:45991
20:74415

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List