4 ms·
> but hopefully none of your candidates need anywhere near 1/2 hour to code stuff that simple I have no idea how to calculate Fibonacci numbers. I'm a decent
by grecy 4y ago
> but hopefully none of your candidates need anywhere near 1/2 hour to code stuff that simple
I have no idea how to calculate Fibonacci numbers.
I'm a decent coder, have a bachelor of Software Engineering but never "loved" math.
I'm sure I could learn in a three minute Google.. but I certainly couldn't do it on a whiteboard with no Google access.
- JoeAltmaier 4y agoAdd the previous two numbers to generate the next one: 1 1 2 3 5 8 13 ... That's it. Now you know.
- grecy 4y agoAfter typing that comment I googled it, and the source I read said that it must start with 0, 1, 1, 2
- JoeAltmaier 4y agoSure whatever your initial conditions are. If you start with [ 0 1 ] then it works too.
- arthurcolle 4y agoyes, the above is true. Kind of shocked that anyone could get through an intro CS course without having knowledge of this as it is a very common type of sequence. It also generalizes, apparently "Fibonacci sequences" are defined by the initial 2 values, with the rule mentioned above. I thought this was weird once but upon checking it it is true that, for example, 4 5 9 14 23 37 would also be Fib{4,5} or something. Idk it's been a long time.