r/programming • • 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.1k comments sorted by

View all comments

334

u/vital_chaos May 08 '15

Yeah I write Fibonacci sequences all the time. It's my hobby. /s Why do people think that writing short test functions in an interview has anything to do with actually delivering products? Sure some ditch digger might fail at these, but does it tell you anything about how well they build actual apps?

3

u/Otis_Inf May 08 '15

The fibonacci one is also silly for another reason: if you know the trick (as in: you have seen the code before and remembered how to do it), you know the answer, so it tests on that you know the answer, rather than that you can solve something with recursion (which is the underlying CS element taught by the fibonacci example).

I also found 5 not a trivial question or even 'simple'. (admitted, it's early and I'm on my first coffee, but still). I couldn't immediately see an answer to it other than brute force. Spoj has taught me that brute force is never the answer so I was a bit annoyed that the author claimed they were all ridiculously simple and I didn't see the answer right away...

2

u/ismtrn May 08 '15

The fibonacci one is also silly for another reason: if you know the trick (as in: you have seen the code before and remembered how to do it), you know the answer, so it tests on that you know the answer, rather than that you can solve something with recursion (which is the underlying CS element taught by the fibonacci example).

Are we reading the same question? The "trick" is right there in the question. If you don't know how to generate Fibonacci numbers, you can just read the question:

the first two numbers in the Fibonacci sequence are 0 and 1, and each subsequent number is the sum of the previous two

Regarding the 5th question, there are 38 = 6561 different possibilities. This can easily be brute forced.

→ More replies (5)