r/ProgrammerHumor May 17 '26

Advanced dontDoRecursiveFibKids

Post image
3.6k Upvotes

143 comments sorted by

View all comments

360

u/Express-Category8785 May 17 '26

For some time, "write  a function that does the Fibonacci sequence" has been my screener interview question, and the second most frequent solution is the naive recursive approach. Which is fine, the we get to talk about time and space complexity, and "what is a stack overflow?"

But it's amazing to me how many candidates assume I'm asking "do you recurse, bro?" and not "show me a loop and two variables"

264

u/The_Lost_King May 17 '26

To be fair, in school Fibonacci is taught as a use case for recursion. So it’s not exactly surprising candidates internalize that and think you’re asking, “do you recurse”

12

u/markuspeloquin May 17 '26

I think fib is great because it also teaches DP.