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

Show parent comments

2

u/WeAreAllApes May 08 '15

The point is to time box them, watch, ask questions, and give hints if needed. The way it almost always goes is either:

(1) They can't produce anything close and they react with a blank stare when you try to give hints (no hire) or (2) They produce a non-optimal algorithm pretty quickly and you use that as a stepping stone to discuss its properties, performance, improvements, style, etc.

If someone did quickly produce a perfect algorithm, perfectly written, I would still ask them challenging questions about it and less optimal variants to make sure they understand what they are doing. Such a person would not automatically be assumed to be better than a person in category (2) from their code alone.

2

u/Otis_Inf May 08 '15

That's all fine but I'd simply leave at that point. I mean, what have you really tested? My ability to come up with answers for small puzzles or my ability to develop large scale complex software? I think the former, while the latter is what you should be testing for. Additionally, with these puzzles you also weed out the people who panic if they don't see the answer right away (i.e. the ones who don't recognize the trick/algorithm needed because they have no knowledge of that algorithm). It's not like one can discover e.g. fibonacci heaps during an interview, you have to know the algorithm up front. Your tests assume one can, which is a fallacy.

It's just silly busywork without any meaning. Instead, give them a real scenario, a real case your developers have to implement, and see how they come up with solutions for that. Because that is what they'll be doing and you should be sure they're able to get that work done.

Puzzles are nice for spoj and fun, not for interviews.

1

u/WeAreAllApes May 08 '15

So you would either produce a perfect algorithm or be stumped?

And if I asked you to explain why the perfect algorithm is better than doing xyz, you would say "This is BS. I don't need to understand how the code works to do my job"?

And if you are stumped and I explain an algorithm in English, you would say "This is just busy work, I don't have to prove to you that I know how to declare a variable"?