Hacker News new | ask | show | jobs
by lloyd-christmas 3543 days ago
Interview question: "iterate over an array":

  angular.forEach([1,2,3] ...

  $.each([ 1, 2, 3 ], ...

  [1,2,3].forEach(...
One of these things is not like the other. I hire people that know javascript, not ones that only know the tool we use. The tool we use today may not be the tool we use 6 months from now. I've never asked a javascript question that required framework knowledge unless it was explicitly about concepts of the framework. Someone taking the time to include jQuery is instantly out the door. Walking through people's code demonstrates whether or not they default to other people's solutions than their own.

This isn't to say your experience didn't happen, I'm just pointing out that there is a lot more that goes into it than just which framework the cool kids are using nowadays.

4 comments

> Walking through people's code demonstrates whether or not they default to other people's solutions than their own.

Sorry, what does this even mean? When we consider it bad to use an external solution we call it Introducing Unnecessary Dependencies, when we consider it good to use an external solution we call it Not Reinventing The Wheel.

What you're doing here is fetishizing some arbitrary knowledge that you've set up as a litmus test. I've hired probably close to a hundred engineers by this point in my career, and I have to say, unless you are hiring for specialists to fill a very specific purpose, the only test that matters is Joel Spolsky's smart-and-gets-things-done test. There are plenty of web developers out there who only ever used jQuery and thus never learned javascript properly—that says nothing about their talent. There is a good portion of them who, upon being told, "we don't use jQuery here, just raw javascript" will learn and be better at it than you in a couple months. Even more importantly, any good engineer is going to have a lot experience which you don't have, and which to you is an unknown unknown. The best team is made up of diverse backgrounds and experience, not a bunch of people who managed to pass through a series of arbitrary knowledge gates.

I have to say, this strikes me as an odd way of filtering out bad developers. jQuery is a time-saving library.

It seems like you're presuming that they must lack proficiency in the DOM if they're choosing to use jQuery. Perhaps you're trying to say you want to see them demonstrate that they're not just copy/paste coders.

Given your code example above, I wouldn't want a candidate to know the difference between each `forEach` method, but I would expect them to know that each provides a means of iterating over a set of values.

> I have to say, this strikes me as an odd way of filtering out bad developers.

I don't use this in my interviews, and I'm surprised everyone took this literally given that we have a weekly blog article about the villainy of technical interviews and how they destroy the very fabric of software development. I'm using a hyperbolic example to demonstrate what I perceive as a negative trait; A reach for unnecessary tooling to solve simple problems. My hiring experiences have pointed towards it being indicative of a comfortable one-trick-pony.

> Given your code example above, I wouldn't want a candidate to know the difference between each `forEach` method, but I would expect them to know that each provides a means of iterating over a set of values.

Likewise. However, if I'm hiring someone for a back end role, I'd expect them to be able to know basic SQL and not just their language's ORM. I'd expect them to be able to type `cd` and not just navigate through their IDE. I don't think there is anything different between that and the relationship of jQuery/angular and vanilla js. jQuery isn't written in jQuery. Debugging rarely stops at the script tag/require statement.

My original comment was actually in the opposite direction: the interviewers were looking for comfort with a framework other than jQuery that showed that I knew more than vanilla JS. That was the frustrating part.
@cloverich I think this comment is showing exactly how the author of the article wasn't exaggerating
I don't follow. Are you saying _I_ demonstrate why the article isn't exaggerating, or that some of the people I've interviewed are?
I am saying that you demonstrate why the article wasnt exaggerating. Cloverich stated that using jQuery was fine and the article was exaggerating how far it has fallen out of favor, but you have stated that anyone using jQuery is out the door when interviewing with you. Therefore theres at least a group of people that article is accurately describing
> Cloverich stated that using jQuery was fine and the article was exaggerating how far it has fallen out of favor, but you have stated that anyone using jQuery is out the door when interviewing with you

That isn't what I said in the slightest. My criticism had nothing to do with jQuery. Go back and replace jQuery with underscore, lodash, ramda... I'm not saying that I would turn away a jQuery developer when interviewing for an angular position. I said that a negative defaulting to a framework/library to solve a vanilla problem is a problem in and of itself. "One of these things is not like the other" is the native Array.prototype.forEach(). It's literally built into the language, and the person added a script tag to include an 85kb file just to run a loop over 3 elements. THAT'S the problem.

> Go back and replace jQuery with underscore, lodash, ramda... It's literally built into the language, and the person added a script tag to include an 85kb file just to run a loop over 3 elements. THAT'S the problem.

Well, jQuery in particular is somewhat of an exception. It achieved such a high level of ubiquity, and solved such a vast array of cross browser issues, it was not unreasonable for a front-end dev to add jQuery as the first step in any project. Similarly, while its "literally built into the language" that's only true in cases where you can drop IE8 support. I would personally be very surprised if there weren't still more quality developers who knew the jQuery or underscore api's better than the native javascript ones.

I think the more general sentiment here is: If you use map / reduce / forEach / etc with jQuery / underscore very well, you can very easily transition into dropping or changing those libraries. But your comment made it sound like you were less interested in how well they could code and more interested in which API's they knew (and knocking them for defaulting to the most widely known ones).

To add onto this, this was not an attack or criticism against your methods lloyd-christmas. This was more the fact that I was pointing out that the front end dev world is so fragmented that almost any view point is something you'll come across while interviewing. Your point that this is a simple task to solve without a library is a valid one, but you'd also be as likely to find a team who expects you to default to a library because any non trivial project would require it. The main problem that I think is at the heart of this conversation is that the expectations of what you know and how you work is far too fragmented for most people to keep up with
> Interview question: "iterate over an array":

  for(let thing of things) {...}
forEach only obfuscates the imperative nature of your loop.