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
2
u/ismtrn May 08 '15
You don't have to use recursion. I would say that if you can't write a function which generates a list where each element is the sum of the previous two elements(with recursion or otherwise), then you are not very good at programming.
Generating all the possibilities is not at all trivial compared to the other problems in my opinion. How do you represent the list of operations you have to perform on the numbers? How do you generate all combinations? How do you test the combinations?
In general being able to generate all possible combinations of something is usefull, and often the basis on which you build more clever algorithms.