Live data from Hacker News

5 programming problems every Software Engineer should be able to solve

blog.svpino.com

1–10 of 13 posts

Re: 5 programming problems every Software Engineer should be able to solve

#2
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.

Re: 5 programming problems every Software Engineer should be able to solve

#6
post #5

I took a chance and wrote a solution in Python.. in less than an hour. 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 :)

Looks good!

Re: 5 programming problems every Software Engineer should be able to solve

#7
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.

Re: 5 programming problems every Software Engineer should be able to solve

#10
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.
Post reply on HN