5 ms·
Generally, I start by getting an idea of how well a candidate understands JavaScript with a problem like this: Write a function that enables the following API.
by bzalasky 10y ago
Generally, I start by getting an idea of how well a candidate understands JavaScript with a problem like this:
Write a function that enables the following API...
createOlympian()
.name('Katie Ledecky')
.sport('Swimming')
.country('USA')
.log()
// Katie Ledecky, Swimming, USA
Next, if things are going well, I have the candidate transform a JSON collection response to match some arbitrary requirements using Lodash/Underscore.
After that, I focus on the candidate's experience and talk about projects they've worked on, their process and what they're looking for in their next position.
If you're a front-end candidate that's solid at design, visualizations or complex layouts, I'd encourage you to bring your personal laptop and show off some of the work you've done on your own.
- franciscop 10y agoI might have experience but that still looks totally trivial for me... is many people not passing the first test?
- bzalasky 10y agoIt's not meant to be difficult. You'd be surprised how many people don't pass this. The most important part of the interview for me is when we advance to talking about what a candidate has actually done.
- franciscop 10y agoThat's my point, I've read many times that I'd be surprised how many times people don't pass this (and I agree) but I'd love to know how many. Could you share please?
- bzalasky 10y agoGenerally the candidates that don't pass that first question don't have sufficient experience with JavaScript. Sometimes this is because they have more experience on the backend and for whatever reason said they knew JavaScript on their resume and found themselves in the frontend portion of a fullstack interview. Other times the candidate has a lot of experience with CSS and layouts, but doesn't have much experience with JavaScript beyond jQuery. Out of five candidates, two might fail this... but it comes down to the candidates in the pipeline. Working closely with your recruiters can take that number down to zero. I've found that filters like this become more necessary when there are a lot of positions to fill.
- patrickdavey 10y agoPointers on how to improve this (while maintaining your API) would be great :) var createOlympian = function() { return (function() { var attrs = []; // private variable for our olympian attributes var olympian = { name: function(name){ attrs['name'] = name; return this; }, sport: function(sport) { attrs['sport'] = sport; return this; }, country: function(country) { attrs['country'] = country; return this; }, log: function() { console.log(attrs['name'] + ", " + attrs['sport'] + "; " + attrs['country']); } }; return olympian; })(); };
- insin 10y agoBonus points for being meta? function createOlympian() { let props = ['name', 'sport', 'country'] let olympian = { log() { console.log(props.map(prop => this[prop]).join(', ')) } } props.forEach(prop => { olympian[prop] = function(value) { this[prop] = value return this } }) return olympian }
- tkxxx7 10y agoThis is neat, but those functions can only be used once.
- Spoom 10y agoThis would work, but attrs should really be an object (i.e. var attrs = {};), not an array, since you're storing string keys, and stylistically you can just use e.g. attrs.name instead of attrs['name'].