Live data from Hacker News

Ask HN: What did I do so wrong in this coding interview

news.ycombinator.com

71–80 of 98 posts

Re: Ask HN: What did I do so wrong in this coding interview

#71

Earlier quoted context omitted.

Well in that case, there's nothing crazy about it. If I can hire someone whose code is reasonably self-explanatory vs. someone who puts comments all over their code (whether or not it's self-explanatory), I'm certainly not going to choose the second one over the first one, not sure about you.

You just said if I took the same self-explanatory code and added comments to it that you deem unnecessary you'd no-hire me as a result. And yes, that is absolutely crazy, and has been my point throughout this entire thread. Please do me the respect of researching literate programming before attempting to extend this thread, because I can tell you're unfamiliar, just based on how many ways you're trying to slice and d…

Notice I never even mentioned the phrase "literate programming" when responding to you? It's because I'm not trying to debate programming philosophy here, I'm trying to address a practical/immediate concern of the OP. I can debate with you day and night about what programming methodology is best, but that's not what the question here has been about, and I'm doing my best not to divert the discussion into a different direction.

The debate has been about why the OP's code was considered poor by the employer, and I think putting too many comments might have been such a reason. Whether or not you think putting too many comments is good or bad is orthogonal to whether or not it might have been a reason for rejecting the OP as a candidate. I think it's a reason for avoiding hiring the OP (see my previous discussion about productivity and wasting time writing comments), and whether you feel it's actually justified by some "good" coding methodology is orthogonal to whether or not the employer might have used the same rationale as me, and that's all I'm trying to address here. If you feel the employer's rationale was unjustified or crazy, then so be it; that doesn't mean the employer couldn't have had this thought process anyway.

Re: Ask HN: What did I do so wrong in this coding interview

#72

Earlier quoted context omitted.

You just said if I took the same self-explanatory code and added comments to it that you deem unnecessary you'd no-hire me as a result. And yes, that is absolutely crazy, and has been my point throughout this entire thread. Please do me the respect of researching literate programming before attempting to extend this thread, because I can tell you're unfamiliar, just based on how many ways you're trying to slice and d…

Notice I never even mentioned the phrase "literate programming" when responding to you? It's because I'm not trying to debate programming philosophy here, I'm trying to address a practical/immediate concern of the OP. I can debate with you day and night about what programming methodology is best, but that's not what the question here has been about, and I'm doing my best not to divert the discussion into a different…

This entire subthread for 45 minutes, me talking to you, has been me talking about programming philosophy with you. OP left my mind on this a long time ago. By your examples, I felt like you were coming along with me (two arbitrary candidates, for example), so I don't even know what we're doing here.

We're not on the same page here, clearly.

Re: Ask HN: What did I do so wrong in this coding interview

#73

Earlier quoted context omitted.

Notice I never even mentioned the phrase "literate programming" when responding to you? It's because I'm not trying to debate programming philosophy here, I'm trying to address a practical/immediate concern of the OP. I can debate with you day and night about what programming methodology is best, but that's not what the question here has been about, and I'm doing my best not to divert the discussion into a different…

This entire subthread for 45 minutes, me talking to you, has been me talking about programming philosophy with you. OP left my mind on this a long time ago. By your examples, I felt like you were coming along with me (two arbitrary candidates, for example), so I don't even know what we're doing here. We're not on the same page here, clearly.

Sorry?

Re: Ask HN: What did I do so wrong in this coding interview

#74
post #29

You seem like a sharp developer who shouldn't be spending your time doing bogus homework in today's market. Out of curiosity, whereabouts are you located?

Thanks. I am a French expat in Hongkong

Cool. If you wind up in southern California hit me up.

Re: Ask HN: What did I do so wrong in this coding interview

#75

Disclaimer: I'm posting this under a new dummy account because I don't want this to be seen as feedback from my company. We didn't interview you, but I'm a senior manager and I want to help w/o implicitly dragging my team into it. (The key word is also "help"; I'm not trying to belittle you, just give my honest assessment of this project, quick as it was to create.) tl;dr: I agree with the assessment that this doesn'…

Composer is package management for PHP. Just like Gem or NPM. IMO such a test can be interesting to assess the ability of a developer to organize his logic and architect an application, but using it to evaluate the ability to produce "production ready" applications is my opinion missing the point as it's in the former that you can see the core ability of a developer while the later just requires time investment and tedious grunt work tasks. Witch is why I chose to concentrate on what matters.

Re: Ask HN: What did I do so wrong in this coding interview

#76

1. When your comments are longer than your code, either you're putting in too many comments, or your code is too hard to read. (The former seems to be the case here.) 2. Why is the spacing convention all over the place in some files? https://github.com/m4nuC/memGame/blob/master/app/controllers... https://github.com/m4nuC/memGame/blob/master/app/database/mi... 3. Why are there so many folders that only have .gitignore…

> 1. When your comments are longer than your code, either you're putting in too many comments, or your code is too hard to read. (The former seems to be the case here.) I hate this meme. There's nothing wrong with too much commentary. You are not on a comment budget. Please stop spreading this around, like the "rewriting is always a bad idea" meme that's embedded itself in young developers like dogma even though Spol…

Strongly disagree. The fewer comments the better. Reviewing and maintaining code is hard, and within reason you want the code to be expressed in as few bits as possible while maintaining readability and good structure. Comments in English are just another thing for me to have to process mentally when understanding the code. Even worse, there is no constraint on the comments that they have to be accurate. Code at least has to appear to be working correctly. Every single comment added to the code comes with zero guarantee about whether it's true or not. Similarly, the comments can get stale, and there is nothing technically opposing that.

Literate programming is a horrible idea; comments in code encourage verbosity and showing off, lack any guarantee of correctness and should always be a last resort.

Re: Ask HN: What did I do so wrong in this coding interview

#77
post #64
post #32

Earlier quoted context omitted.

So using abstraction is not something a senior does ? It seems to me like the contrary. The more experience I have the more I like to abstract things instead of making them from scratch. But even so it seems a bit heavy of judgement to disqualify me with such strong word over this choice.

There's nothing wrong with abstraction. But you should use the right abstraction for the job. You don't need a huge PHP web framework, tons of dependencies, an entire package manager, sudo access, and so on to have a simple memory game with a high score backend. Remember, when you're looking for a job, you're not looking to create some build and forget application. You're going to be working as part of a team. Other…

Regarding 1. As far as I know, npm says in it's docs you should add node_modules to your scm because there is no way to install the exact same version through npm on different machines. On the other hand, composer has a .lock file which specifies commit hashes it installed on the dev machine, so a composer install installs the exact same commit on every machine.

@OP: You didn't commit the composer.lock. That means that your code might run locally but breaks on another machine because there might be a new version of laravel 4.2

Re: Ask HN: What did I do so wrong in this coding interview

#78
post #64

Earlier quoted context omitted.

There's nothing wrong with abstraction. But you should use the right abstraction for the job. You don't need a huge PHP web framework, tons of dependencies, an entire package manager, sudo access, and so on to have a simple memory game with a high score backend. Remember, when you're looking for a job, you're not looking to create some build and forget application. You're going to be working as part of a team. Other…

Regarding 1. As far as I know, npm says in it's docs you should add node_modules to your scm because there is no way to install the exact same version through npm on different machines. On the other hand, composer has a .lock file which specifies commit hashes it installed on the dev machine, so a composer install installs the exact same commit on every machine. @OP: You didn't commit the composer.lock. That means th…

Can you provide a link to that? That's not how npm works at all. You specify dependencies as a dictionary: keys are package names, and values are versions. They support commit hashes, but do not require them. See: https://www.npmjs.org/doc/package.json.html#dependencies

Re: Ask HN: What did I do so wrong in this coding interview

#79
post #50

Disclaimer: I'm posting this under a new dummy account because I don't want this to be seen as feedback from my company. We didn't interview you, but I'm a senior manager and I want to help w/o implicitly dragging my team into it. (The key word is also "help"; I'm not trying to belittle you, just give my honest assessment of this project, quick as it was to create.) tl;dr: I agree with the assessment that this doesn'…

I'm not the OP but I really appreciate your answer. Thank you for taking the time. What is the "right" amount of time/effort to put into a "job-application" project like this?

As much as they give you, minus a few hours. Give the impression that you can meet/beat deadlines, but be sure to utilize as much time as you can and deliver something that's of the calibre they're expecting. For example, if they give you 3 days for a project as simple as this, they probably expect something production-ready: polished, cross-browser tested, responsive, etc. Deliver exactly that in under 72 hours and you should be fine.

Re: Ask HN: What did I do so wrong in this coding interview

#80
post #53
post #32

Earlier quoted context omitted.

So using abstraction is not something a senior does ? It seems to me like the contrary. The more experience I have the more I like to abstract things instead of making them from scratch. But even so it seems a bit heavy of judgement to disqualify me with such strong word over this choice.

Also, please do not confuse abstraction with reuse. "abstracting things" has nothing to do with "making them from scratch". You're definitely conflating two things inappropriately there. I can write reusable code that has absolutely no abstraction in it, and I can write code based on an abstraction that is completely un-re-usable.

Arguably, the conflating of those ideas would speak to his readiness for a senior role.
Post reply on HN