

5 programming problems every Software Engineer should be able to solve - fwilliams
https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour

======
halflings
Doesn't it say a lot that the author himself gave a wrong solution to the 4th
problem at first? Does he think he's a failed Software Engineer? (I wouldn't)
... because he does say on the 5th problem's solutions that he wouldn't
consider anyone that wouldn't find a correct solution to those exercises.

------
Someone
For software engineering problems, it surprises me that he puts #5 after #4.
For #5, it is almost immediately clear that brute-forcing it will work (there
are 3^8 solutions to place pluses, minuses, and 'nothings' between those nine
digits. That is 81^2, way less than 10000)

#4, on the other hand, may have an input with a million integers that would
probably make that Java solution, with all its toString calls _and_ string
concatenations inside the comparison function that will get called in the
ballpark of a billion times, slow down to a crawl.

That's why the proposed solution to #4 is not that of a software _engineer_.
An engineer would convert those integers to strings only once. He might keep
the concatenations around because they aren't shown to be problematic yet.

------
gamechangr
I actually disagree.

I could do this problems fairly easily, but #4 and #5 are harder than they
look.

Are you working in Python or Ruby and are good at managing your emotions
during interviews -- then you'ld do good. (or might do good).

I would guess there are a number of "qualified" entry level programmers who
would struggle to get these done in an hour, especially if you are talking
about front end developers or something that is more verbose like Java.

------
gnuvince
I think it's not a bad list to weed out the cheats, though perhaps #4 and #5
weed a bit too wide. I solved #4 a couple weeks ago after a friend of mine who
interviewed for Google was asked exactly this (he didn't whine, and eventually
got a working solution), and it did take me the better part of an hour fixing
up the edge cases.

------
flaie
I took a chance and wrote a solution in Python.. in less than an hour.
[https://gist.github.com/agrison/1a27a50c22a7f46df17c](https://gist.github.com/agrison/1a27a50c22a7f46df17c)

Next step is to print that and show my boss what a privilege it is for him to
have me in his team :)

------
4ydx
Here is my go at #4. It took me more time than I would like to admit :)

[http://play.golang.org/p/CTZahLt7g1](http://play.golang.org/p/CTZahLt7g1)

------
user12340987
#4 and #5 are definitively harder than they look.

------
alvarospain
Nice read. Not sure I agree with this.

