Live data from Hacker News

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

news.ycombinator.com

51–60 of 98 posts

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

#51
I see a disconnect between balance of dependencies vs. the minimum required to yield the target result. A lack of focus on the thing you are trying to show... coding skill/efficiency around the game problem. The tight piece should be a great set of game code. I see, which I see a lot when I see IoC for small jobs, inversion of focus. Lots of ceremony yielding a loss of clarity.

You know laravel. You know about libraries and can use them. It's less clear that the code you wrote was good. It's sort of buried in a fair bit of noise.

You won no favors by requiring an install of the nature you have and fumbling that a bit as well (chmod 777).

The other thing is... you can't trust a potential employer's reason for saying, "No." They said it, but you don't know if the message is garbled by the HR rep or even a flat out lie because the short answer is, "No." and they don't want to spend time explaining themselves.

They decided and moved on. They are not invested in your future. Coming here for feedback is a good practice. We care about you and have few reasons to just let you know, "No."

Soooo many dev job fish in the sea. Get your line back in. Your bait is fine.

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

#52

Earlier quoted context omitted.

Perhaps framework was the wrong choice of word. I wouldn't call jQuery a framework, but it certainly would have helped. A library like Rivets.js or similar would have been great to see as well, since at that point there'd be (close to?) 0 manual DOM manipulation required (thus obviating the need for jQuery), and he could still keep the page weight easily under 10k.

But what's the point? These days, there's not a whole lot jQuery does that can't be done easily with vanilla JavaScript. Would you rather hire someone who can write lean code with minimal dependencies or someone who throws in whatever library is getting the most buzz "just because"?

I'd rather hire the guy who writes the most maintainable code. jQuery is hardly a "buzz" library, and in this case, using it certainly wouldn't be "just because". It's been the industry-standard method of non-trivial DOM manipulation for years. If he included Angular or Ember or some other nonsense, then I'd be concerned for the exact reasons you stated.

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

#53
post #32

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'…

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.

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

#54
post #40
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.

(this is probably not going to be a very popular answer here, since most people enjoy making things abstract, and feel like they're creating value) Making things too abstract, too early, is usually a bad sign. In most cases, the most most specific and straight forward solution to a problem is the best one. There's definitely cases where you're simplifying things by making them more abstract and reusable (but making s…

Yep, it's that balance between abstraction and indirection.

Abstraction can be a great tool, but it comes with the cost of added indirection.

You want to aim for the sweet spot in the middle somewhere.

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

#55

I'm trying to figure out how much effort went into this. I ran cloc, and here's what I got: -------------------------------------------------------------------------------- Language files blank comment code -------------------------------------------------------------------------------- Javascript 1803 66480 85484 423029 HTML 57 847 79 20374 SASS 19 21 8 12114 C++ 38 1011 763 7700 C/C++ Header 45 816 713 5165 CSS 16…

TIL about cloc! Thank you good sir. It seems as though this is because he had node_modules checked into source control on the frontend part. npm basically likes to download the whole internet when you run npm install, so these stats do not suprise me. Checking in that directory is generally discouraged, but its possible he wanted to avoid adding the node dependency in order to ease installation.

You are correct. Here are the revised numbers after excluding public/scripts/node_modules:

  -------------------------------------------------------------------------------
  Language                     files          blank        comment           code
  -------------------------------------------------------------------------------
  PHP                             36            330           1048            597
  Javascript                       9            101             86            362
  SASS                             6              4              4            127
  XML                              1              0              0             18
  CSS                              1              0              0              1
  -------------------------------------------------------------------------------
  SUM:                            53            435           1138           1105
  -------------------------------------------------------------------------------

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

#56
FWIW instructions dictate "1) Use directional arrows to select a card. 2) Use "Enter" or "left click" to flip a card"

In the demo I can use arrow keys. But only left click can flip a card. [enter] does nothing (using Chrome Version 35.0.1916.153 m on Windows 7).

If they tried it and it failed (and if they had a big pile of submissions to get through) this would've definitely counted against your submission.

--

More generally, having looked at what this game actually does vs number of lines of code I would use one word to describe it - overkill.

--

Let me add. It was very helpful of you to post this question. Informative (I hope) for you, but also for everyone else, as we contemplate what coding mastery is really about.

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

#57
post #23

Eh. These things are highly subjective. Seems competent overall: I'm not wowed, but these types of assignments are, as you surmised, about establishing baseline competency. Some thoughts for the future: 1) PHP was a bad choice; some people have a burning, irrational hatred for it, and it leads them to judge your work in the harshest light instead of an evaluative one. 2) Speaking of burning irrational hatreds: PLEASE…

(Note: the following is not criticism directed at you . I'm merely using your comment as a springboard for commentary about the industry on many matters you also show you are aware of.) These things are highly subjective. Yes. leads them to judge your work in the harshest light instead of an evaluative one Should any professionals have to present apologetics for others in his procession doing such a thing? We are all…

>> leads them to judge your work in the harshest light instead of an evaluative one

> Should any professionals have to present apologetics for others in his procession doing such a thing? We are all human beings, but shouldn't we be trying not to be this quickly and arbitrarily judgemental

Well sure. But this is php we're talking about here.

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

#58

I'm trying to figure out how much effort went into this. I ran cloc, and here's what I got: -------------------------------------------------------------------------------- Language files blank comment code -------------------------------------------------------------------------------- Javascript 1803 66480 85484 423029 HTML 57 847 79 20374 SASS 19 21 8 12114 C++ 38 1011 763 7700 C/C++ Header 45 816 713 5165 CSS 16…

TIL about cloc! Thank you good sir. It seems as though this is because he had node_modules checked into source control on the frontend part. npm basically likes to download the whole internet when you run npm install, so these stats do not suprise me. Checking in that directory is generally discouraged, but its possible he wanted to avoid adding the node dependency in order to ease installation.

NPM actually encourages you to check the directory in when building something deployable like a website or app: https://www.npmjs.org/doc/faq.html#Should-I-check-my-node_mo...

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

#59
It only means they didn't deserve you. I have gone through a few interviews of this nature off late. Given the, timelines(and technology limitations) they give you to complete the assignment and return it to them and managing a day job with family, frankly speaking I had to slog through whole nights for sprints of 3 days. For nearly a month for various interviews.

At the end some companies appreciated it and some just plainly gave a very discouraging feedback.

If you can't appreciate a person who can deliver your requirements with 100% features covered and well tested to the point without wasting any time on clarifications, under crippling timelines- Then clearly you are looking for men from an another planet.

You must just wish those companies all the best and move on. They are ultimately going to hire some career cup scraper any way.

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

#60

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 Spolsky's point is up for debate. Atwood is wrong about this one, too, and I hate that Spolsky and Atwood have so many "rules" of programming that people pass around.

I've seen this meme borne out via comment ratio rules in style guides. That's ridiculous. We all work in editors that make comments a different color. I use light gray. My eyes can look right past them, but if I want the paragraph or two explaining the algorithm I'm looking at, it's there. The underlying flaw in Atwood's claim is that it is possible to write code in a way that is self-evident to every reader. You do not know every reader.

Well-written commentary -- bordering on literate programming -- makes development much better. Even better if the code is the documentation. I don't know where this notion that we must conserve comments like water came from, but I'd be happy if it just stopped.

Note here that I'm addressing quantity, not quality. I feel that is important to clarify.

Post reply on HN