Live data from Hacker News

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

news.ycombinator.com

31–40 of 98 posts

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

#31
post #7

I briefly took a look at the code and I'll help you out with some honest feedback (I've hired before). The problem looks like it's on the frontend, mainly. It doesn't look like you're leveraging a framework (instead manually munging the DOM), which suggests unfamiliarity with modern framework-based frontend development flow (this may or may not be true). Regarding the backend, it looks like mainly PHP framework copy-…

With all due respect, it's a memory game, not a large-scale web application. I don't understand why "frameworks" are the answer to everything these days. There's nothing wrong with interacting directly with the DOM, especially for something like this.

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.

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

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

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

#34
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's inside them? In fact, why are there so many folders at all?

4. In my glances at some of your files I didn't find a single function with a lot of "meat" inside it, so it doesn't show much about your ability to write something that actually does something.

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

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

A more important principle than "abstract everything away" is "write only what you need". You don't always need abstraction.

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

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

The message you are responding to never mentioned abstraction. You did not address any of the (multiple) issues it did raise.

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

#38
Without seeing the prompt they gave you and not knowing the context you would have gained from the technical interview, we're all just guessing here.

My guess is that they were expecting a much simpler application for a simple problem. Also for a JS game with a tiny backend, the Github project code is heavily weighted toward PHP (73% PHP vs 20% JS). Perhaps in their internal discussions, a word like "over-engineered" was brought up.

I'm not saying that it's bad code. It looks fine to me.

Other point is that the technical interview is a time to ask questions for the interviewee (when they allow). What is their development process? Do they iterate and prototype a lot, or is their process closer to waterfall? Assuming their stack is primarily PHP, do they use a framework? Do they follow MVC? Do they use a JS framework? Etc... Having known the answers to these questions would have helped you create an application that looked closer to their comfort zone. (Even if you don't know a coding test is coming, you still should want to know the answers to these questions so that you can know if you are getting into a situation where you might have to maintain old applications written in PHP 4, for instance.)

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

#39
Agreed w/ honestfeedback.

- Overall project structure seems a bit unorganized IMO (no centralized build process, gulpfile inside subfolder). Overall this makes it fairly hard to dive right into the project. It might be my lack of experience in PHP project structure.

- I think pulling in a server & a db might be an overkill. Local storage will do the job perfectly.

- Mix of tabs & spaces is also very messy.

- Styling is pretty sloppy too I believe. No clear organization/reusability in the stylesheets.

- Vendor scripts/generated scripts should not be committed to the repo IMO. There're already bower & CDNjs & a bunch of other services.

- Your JS is also very module/singleton-based although some of them are clearly object-oriented. Also seems to be a mix of jQuery usage & DOM directly, why not 1?

I think what they're looking for is a couple of simple JS that's easily tested, maintained & expanded which IMO is more important for senior candidates. Less senior ones can always bang this out quickly but senior ones care way more about other attributes of a project than just getting it done asap.

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

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

(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 something reusable before you need to reuse it is a waste of time) -- another good case is where you're using the principle of separation of concerns.

I think when I started developing I made everything very abstract, b/c all the books you read would also tell you that was a good thing.

It's not. Until you need to, at least.

Post reply on HN