Friday 15 May 2015

How do you judge a Javascript programmer by only 5 questions?

1. Can you explain the difference between call and apply to me?
The answer to this question is a bit of a factoid, so that someone can answer it doesn’t give you any information, but if they cannot, it gives a truckload. Any JavaScript programmer that has written a library or two, not used libraries built by others, will know the answer to this.
Addendum: Several people are calling #1 into question. I must be very clear here that I stand firm on this one. If you haven’t used apply, you are most likely missing out on the most powerful and overlooked aspects of the language. It’s also an indicator that you haven’t tried your hand at building a library yet, because when building libraries, apply and call are very commonly used.
2. Can you explain map to me?
  1. Map is a an extremely useful functional programming concept that any compsci person will know. If someone doesn’t know this, it’s a sign that they lack an understanding of computer science and/or lack an understanding of the language. In addition, the explanation itself will give you a sense of how much the person knows about the language just in the way they talk. If the person does well on this question, ask aboutreduce as a followup. If you do not know what map is, it means that you have done zero functional programming and you’re missing out — start your journey here: A dirt simple introduction to higher order functions in JavaScript.
  2. 3. Can you explain bind to me?
  3. This is a really great question, because it delves into the concept of this. You can basically drill the interviewee for quite some time on this, as it is a very large subject. You’ll get a good sense of a programmer by having this discussion. If the interviewee responds well to the question, ask them to explain prototype.
  4. 4. Can you explain how closures work to me?
    This is a great question to ask programmers that claim to be experienced in general, but not with JavaScript. Closures are a general programming concept that is extraordinarily important in JavaScript. If they understand closures well, they will learn JavaScript pretty quickly.
  5. 5. Can you please tell me a story about a JavaScript performance problem that you’ve encountered and how you approached solving it?
    This will tell you a lot about how much programming a person has actually done, in their own words. A big one to keep an eye out for is that they should be praising the Google Developer tools, and not rely too much on theoretical time complexity.
If you don’t know the answers to these questions, please don’t feel discouraged. Instead, get excited that the language that you’re coding has much more depth than you thought, and that you have some really cool stuff to learn.

No comments:

Post a Comment