r/programming • u/svpino • May 08 '15
Five programming problems every Software Engineer should be able to solve in less than 1 hour
https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour
2.5k
Upvotes
1
u/rocky_whoof May 08 '15
Fibonacci is a terrible example of recursion, and if this is the way you go about it you're going to have a bad time (well, an out of memory exception). Even with limitless memory available, doing it naively for the 100th number is unfeasible strictly for time constraints.
The "trick" is dynamic programming. And it's not a trick, it's actually a very useful algorithmic approach. I'd rather have someone know what it is than simply memorize it strictly for this particular interview question, but even the latter is better than someone who has no idea what this is.