News for hackers. Stuff that matters.

Ask HN: What's wrong with my JS?

I recently applied for a frontend JavaScript developer position. The first step of the interview process the company asked me to build a car selector in JavaScript. After reviewing the instructions, I decided to use plain JS and EventEmitter.

I was quickly rejected after I submitted my work. The company said they are moving forward with candidates who exhibit stronger coding indicators. I was surprised to be rejected for work that I thought was good, given the boundaries of the task. I created modular code, wrote tests to influence the design, and even used some functional programming.

Should I have put more love into the UI? Should I have used a JS framework like angular or react? Maybe my code is crap and I don't see it.

Obviously, the company can't offer any insight, but can you? I'm stumped. I very much want to know what things I did wrong or areas where I can improve. Thanks!

Task description is in README.md http://bl.ocks.org/luk3thomas/512896ffd7a5dd325de1

( 13 comments | 3 points | on HN )
Re:Ask HN: What's wrong with my JS? by bobfirestone on Monday January 12, 2015 @11:13PM (#8878100)
To start as a couple of others have already pointed out you haven't implemented all the criteria.

If I was evaluating your solution based on what they are asking for I would have passed on you as well. Your solution is unnecessarily complex and over built. They are asking if can you use JS to manipulate a select box. Not including tests you have brought in 400+ lines of code (184 lines of code + the EventEmitter library) to implement 75% of the functionality you were asked for. That is a lot of code to take an item from a select box and add it to a list. Knowing that developers leave I would not want to inherit a solution like this.

To put it in car terms you built a 911 when the customer was asking for a vw bug.

Re:Ask HN: What's wrong with my JS? by whichdan on Monday January 12, 2015 @10:39PM (#8877999)
As someone who has interviewed 50+ developers in the past six months: that code sample would absolutely get you an in-person interview. Your code is fine and the company was probably just giving you a cop-out answer for whatever reason. Don't be discouraged; you should keep interviewing!
Re:Ask HN: What's wrong with my JS? by jqm on Monday January 12, 2015 @10:25PM (#8877949)
"After a car has been added to the wish list, the select box should default to the first alphabetically available car from the same make".

Doesn't happen. Leaves the make and returns to top make after selection.

Re:Ask HN: What's wrong with my JS? by luk3thomas on Tuesday January 13, 2015 @07:21AM (#8879293)
omg, you're right.
Re:Ask HN: What's wrong with my JS? by geetee on Friday January 16, 2015 @10:27AM (#8899433)
Kind of sneaky to put important details in parentheses like they did. I would have let that omission slide, especially considering the typical candidate we get.
Re:Ask HN: What's wrong with my JS? by mattkrea on Monday January 12, 2015 @10:00PM (#8877869)
You missed #3 as far as I can tell.
Re:Ask HN: What's wrong with my JS? by poseid on Tuesday January 13, 2015 @12:53PM (#8881403)
this requirement:

"it also only need to work in Chrome – no IE testing necessary"

sounds like they had a preference for AngularJS. I guess your eventEmitter solution was too advanced for that company.

Re:Ask HN: What's wrong with my JS? by bobfirestone on Tuesday January 13, 2015 @03:25PM (#8882343)
That sounds like a huge leap that because they are only going to test the solutions in chrome that he should have used angular.
Re:Ask HN: What's wrong with my JS? by poseid on Tuesday January 13, 2015 @05:32PM (#8883082)
without putting value to Angular, many companies that say "works in Chrome" mean "developer friendly". And from "developer friendly", it seems a small step to Angular. Maybe because many developers don't want to invest time learning real JS.
Re:Ask HN: What's wrong with my JS? by avinassh on Tuesday January 13, 2015 @12:02PM (#8881032)
Just curious, was it a junior dev position or intermediate?
Re:Ask HN: What's wrong with my JS? by luk3thomas on Tuesday January 13, 2015 @12:45PM (#8881352)
The company didn't make a distinction -- just JavaScript Developer.
Re:Ask HN: What's wrong with my JS? by whoshallsucceed on Tuesday January 13, 2015 @07:39AM (#8879361)
Were you limited by time for this test?
Re:Ask HN: What's wrong with my JS? by luk3thomas on Tuesday January 13, 2015 @08:06AM (#8879490)
No, there was no time limit