TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

5 programming problems every Software Engineer should be able to solve

20 点作者 fwilliams大约 10 年前

8 条评论

halflings大约 10 年前
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大约 10 年前
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 &#x27;nothings&#x27; between those nine digits. That is 81^2, way less than 10000)<p>#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.<p>That&#x27;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&#x27;t shown to be problematic yet.
gamechangr大约 10 年前
I actually disagree.<p>I could do this problems fairly easily, but #4 and #5 are harder than they look.<p>Are you working in Python or Ruby and are good at managing your emotions during interviews -- then you&#x27;ld do good. (or might do good).<p>I would guess there are a number of &quot;qualified&quot; 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大约 10 年前
I think it&#x27;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&#x27;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大约 10 年前
I took a chance and wrote a solution in Python.. in less than an hour. <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;agrison&#x2F;1a27a50c22a7f46df17c" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;agrison&#x2F;1a27a50c22a7f46df17c</a><p>Next step is to print that and show my boss what a privilege it is for him to have me in his team :)
评论 #9513684 未加载
4ydx大约 10 年前
Here is my go at #4. It took me more time than I would like to admit :)<p><a href="http:&#x2F;&#x2F;play.golang.org&#x2F;p&#x2F;CTZahLt7g1" rel="nofollow">http:&#x2F;&#x2F;play.golang.org&#x2F;p&#x2F;CTZahLt7g1</a>
user12340987大约 10 年前
#4 and #5 are definitively harder than they look.
alvarospain大约 10 年前
Nice read. Not sure I agree with this.