Live coding test: JS fibonacci(n) function start from 0 fib(0) => 1
Sigiloso
I answered with my original algorithm which is correct with any test cases. But then they asked if i know the concept of recursive (thanks god i know). So they wanted to see if i can solve it with recursive. And i did. So then they asked about big Oh concept..and wanted me to refactor the not-so-efficient recursive function (which is O(n^2) ). Then i brought him back to my original answered above, which he agreed it's way more efficient since it's O(n), but he admitted he wanted to see if i can solve the challenge. I already lost my appetite lol 10min budget zo do this challenge, i spent probably 5min to do both the original answer of mine, and the recursive one. You can find this kind of challenge and the answer anywhere in any js forums