Live data from Hacker News

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

news.ycombinator.com

11–20 of 98 posts

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

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

I'd suggest paying more attention to how the code shows up in Github next time (assuming they're reviewing it on Github). If I'm reviewing a potential hire's code, I'd want to see that they pay attention to details like that, lest the production code base get super ugly / hard to read.

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

#13
All the other comments so far are valid, but I have something else to add - did they indicate a time frame you had to have it done by, and did you use all of it? Because they may not have been looking for fast turnaround time, they may have been looking for quality.

In the future if you get something similar, you may want to ask what they're looking for (gathering requirements, you might say), and optimize accordingly. Ultimately, it may be completely unrelated, but I've had both kinds of coding tests, ones where I had an hour and had to cut corners as such, and ones where I had an entire weekend and was explicitly told to make it production quality, whatever I felt that entailed.

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

#14
post #12

>Run sudo chmod -R 777 app/storage. Certainly opening up write access to everyone isn't going to win you any points.

I would have made it 755 on my environment but I wanted to make sure the install work properly as I know this is often a friction point during install of Laravel

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

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

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

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

Yeah, I confess I'd find it hard to review someone's code with random-looking indentation going on, it's easy to imagine someone treating it as a bad sign. Definitely fix this for your next interview, keep trying though. :-)

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

#18
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-…

I'd disagree on the JS part. I think given the timeframe and context it's fine as is. He did do a lot of things right such as not leaking globals and using gulp/browserify.

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

#19
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't look like the kind of code I'd expect of a senior developer.

The biggest issue from my POV is that you pull in a _lot_ of heavy-weight frameworks and implicit dependencies for what could be a really simple app. To actually examine the application logic of your submission, I have to flip through dozens of auto-generated PHP files, Javascript module wrappers, and empty directories.

Sometimes, calling yourself a "senior" engineer means doing less, not more. The layers of indirection, framework code, and build toolchain applied here make it harder to follow what your code is actually doing. Coupled with a lack of unit tests, it seems impossible to verify in any short amount of time that it actually works as promised.

Even with all that MVC goodness, the separation of concerns on the client isn't great. There's a mix of display logic and app state visible in lots of places. (IMHO game.js is the worst offender here, as the entire game state and DOM rendering are mixed pretty indiscriminately.)

Finally, asking a reviewer to run a bunch of code from an untrusted repo via 'sudo' is pretty much a giant red flag for me. A simple JS+PHP webapp shouldn't require me to do anything as root on my machine. (I'm also not familiar with Composer, but my brief skimming of the homepage, it seems like the whole point is to not require system-wide installation of dependencies, so the sudo bit is especially weird.)

It looks functional, and if you were interviewing specifically at a shop that used these frameworks and tools, it might not be so bad. If asked to review this without that context, though, I would give similar feedback to what you received.

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

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

Speaking of, why in the world does this small front end app need a Laravel back end? Laravel is a full scale framework the size of rails. This is like doing a ToDo MVC app, the pure js one, and requiring Rails.
Post reply on HN