Re:Data structures and algorithms I actually used while work...
by Taek on Wednesday July 15, 2020 @10:09AM
(#23845428)
Technically, Fib(n) at unbounded sizes is at least linear to compute. This is because the output of Fib(n) has O(n) bits in it. So even if the computation is free, it's still O(n) just to print the result.
That's not the type of thing I would ever expect a candidate to know in an interview, just something fun I've run across.
There is a O(log(N)) solution involving matrix exponentiation though, if you really need to get the big numbers.