top | item 9513102

5 programming problems every Software Engineer should be able to solve

20 points| fwilliams | 11 years ago |blog.svpino.com

8 comments

order
[+] halflings|11 years ago|reply
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|11 years ago|reply
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|11 years ago|reply
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|11 years ago|reply
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.
[+] user12340987|11 years ago|reply
#4 and #5 are definitively harder than they look.