Live data from Hacker News

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

news.ycombinator.com

1–10 of 98 posts

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

#1
A few days ago I applied for a senior Full stack developer in a mid size company. HR interview went great, I had a quick code test on paper that went OK as well, and a quite long technical interview that went great.

The day after the HR sent me an coding test that involved creating a simple memory game in JS with a tiny back end to store high scores. So I banged out this code as fast as possible, while trying to emphasis on maintainability and testability. I sent back the result as github repo:

https://github.com/m4nuC/memGame

Didn't hear back for a few days but eventually arrived a mail stating that "this code felt far short from a senior developer standards" and obviously didn't get the job. I know I cut a few corners, no unit testing, a couple of minor bug and obviously not a production ready app but I thought that would be enough to show that I knew how to build a web app without spending 2 days on it.

I couldn't manage to get any more info from them on what they meant by "falling far short of senior developer standards" So what in your opinion went so wrong about the code?

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

#2
I have not looked at your code but I can say with some experience that it has nothing to do with how you wrote it. There is no way for me to confirm but most likely this is what happens when you turn in a coding test. Someone who is perhaps at a debatable senior level looks at your code and often (I have seen this happening at places where I have worked) gives it to someone else for their feedback. The person your code gets handed over to is often not the person who will make hiring decision. He/she will look at your code and try to discover their own style in your code. If your code does not come close to the way they would have written it then it is bad code.

A lot of things come into play here. Often it is unclear expections. I have done coding tests where the requirement was to pull data from a dataset and cache it in memory. This requirement can be met in many ways. I chose the simplest one but the feedback I got was similar to what you got. It totally depends on where the reader of your code is in the evolutionary stage https://medium.com/@webseanhickey/the-evolution-of-a-softwar...

Reading code is harder than writing.

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

#3
Your game looks generally fine, they're being weird.

Is it possible that you misunderstood and they (a) wanted you to use a different language than PHP (perhaps because they're a Rails shop or something), or (b) wanted you to do this in pure JS, with e.g. localStorage?

Also, the block indentation/braces look deeply messed up on github, any idea what happened?

https://github.com/m4nuC/memGame/blob/master/app/controllers...

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

#5
post #3

Your game looks generally fine, they're being weird. Is it possible that you misunderstood and they (a) wanted you to use a different language than PHP (perhaps because they're a Rails shop or something), or (b) wanted you to do this in pure JS, with e.g. localStorage? Also, the block indentation/braces look deeply messed up on github, any idea what happened? https://github.com/m4nuC/memGame/blob/master/app/controlle…

> Also, the block indentation/braces look deeply messed up on github, any idea what happened?

Combination of using spaces and tabs for indentation. Looks like it'd look fine with tab size set to 4, but it should of course only use one method of indentation.

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

#6
post #3

Your game looks generally fine, they're being weird. Is it possible that you misunderstood and they (a) wanted you to use a different language than PHP (perhaps because they're a Rails shop or something), or (b) wanted you to do this in pure JS, with e.g. localStorage? Also, the block indentation/braces look deeply messed up on github, any idea what happened? https://github.com/m4nuC/memGame/blob/master/app/controlle…

> Also, the block indentation/braces look deeply messed up on github, any idea what happened? Combination of using spaces and tabs for indentation. Looks like it'd look fine with tab size set to 4, but it should of course only use one method of indentation.

Yes it seems like it. Gotta find VIM script to catch those

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

#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-paste. I suspect if someone has a vendetta against PHP (I don't, but some do), that might be a black mark.

If I were to summarize this code, it looks like it was written by someone who can competently hack together a web app on their own, but doesn't have much experience with working on a modern dev team.

I have no idea if I'm right. Just offering an employer's perspective.

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

#9
When developers assess the code of developers, the assessments can often be entirely arbitrary and utterly meaningless. It's one of the worst possible ways of assessing people because almost no-one does it in a scientific, quantifiable way at any level. The assessments are purely subjective.

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

#10
post #6

Earlier quoted context omitted.

> Also, the block indentation/braces look deeply messed up on github, any idea what happened? Combination of using spaces and tabs for indentation. Looks like it'd look fine with tab size set to 4, but it should of course only use one method of indentation.

Yes it seems like it. Gotta find VIM script to catch those

listchars works pretty well. I have this in my .vimrc:

    set list
    set listchars=tab:>=,trail:~,extends:>,precedes:
Edit: you can also configure it to use one type of indentation. I use "set expandtab" so that my files are always indented with spaces.
Post reply on HN