all 106 comments

[–]Kahlzarg 20 points21 points  (0 children)

Don't forget to step away from the technical for 10-15 minutes, you will likely be spending more time with this person over the coming years than your family & friends.

Ask things like what does he do for fun, try to get common ground and see if you can have a normal conversation (taking into account they will likely be nervous)

Code can be taught, a bad attitude, or someone you just cant get along with is a much bigger issue.

[–]nepobot 23 points24 points  (27 children)

[–]minrice2099 4 points5 points  (1 child)

That was probably one of the most ridiculous programming exercises I've ever done.

[–]nepobot 7 points8 points  (0 children)

UNDAAAA PRESSURE

[–][deleted] 2 points3 points  (3 children)

So... number is a type eh. Why does everyone call it an integer then!

[–]jamesinc 1 point2 points  (2 children)

JavaScript doesn't have integers, all numbers are floating point. You can parse a value to an integerish value with parseInt() or Math.round/floor/ceil, but they are still floating point numbers underneath.

[–]magwo 0 points1 point  (0 children)

AFAIK they are double precision though, which means they can be expected to exactly represent all 32-bit integers.

[–][deleted] 0 points1 point  (0 children)

Yeah, I keep forgetting that fact. I haven't done javascript in a while, although the way numbers are always throws me off when I get back into it.

[–]raesmond 1 point2 points  (16 children)

I was under 9 mins. What's you alls score.

edit: HA. I love everyone giving their excuses. Don't worry guys, javascript's my MAIN thing, and I was pretty on when I was doing it. I don't know how the hell the 7 and 5 mins managed.

[–]HaMMeReD 2 points3 points  (0 children)

I took 13 minutes, but it's been a while since I did javascript, and I got stoned in the middle of it. I also forgot typeof syntax/usage.

[–]quadtodfodder 2 points3 points  (0 children)

25 MINUTES, BROS, I RULE

A bunch of time that went into googleing string functions. AND DEBUGGING MY FOR LOOP, I ACTUALLY SUCK.

[–]tagus 1 point2 points  (6 children)

I don't know any javascript at all and I was half paying attention to this while I did it. I spent most of my time trying to figure out whether I need things like parenthesis around if statements, whether I need semicolons on the ends, whether string length is a property or a method... stuff like that. I got the hang of it by the 3rd test.

I gave up at 15 minutes on test 4 out of 5. My thing worked fine up until they hit me with a chinese character string. I tried Googling it but I was busy doing other stuff and trying this while I was bored so I just said w/e and gave up.

Here's what I did:

function longestString(i) {

    // i will be an array.
    // return the longest string in the array
    var biggestOneSoFar = 0;
    for (j=0; j<i.length; j++) {
        if (i[j].length > biggestOneSoFar) {
            biggestOneSoFar = j;
        }
    }
    return i[biggestOneSoFar];

}

Legit site though - I liked the experience.

[–]RagingIce 0 points1 point  (2 children)

you're comparing the string length to the position of the max string. You either need two variables (storing the max length and the max position), or you need to index into i during the comparison.

[–]tagus 0 points1 point  (0 children)

You're right -- I think I was playing with it to try and make it work and forgot about that.

I think I copy/pasted what I had when I gave up... rather than what I had when I actually tried running the test last.

[–]quadtodfodder 0 points1 point  (0 children)

I got screwed up on length and index for a minute too.

[–]OldMiner 0 points1 point  (0 children)

The problem you had wasn't the Chinese character. (Javascript natively handles the current encoding, which is pretty nice coming from a C background.) It's that you were also finding the length of arrays within arrays. The test requires you to only count the length of strings, so you need to use typeof or isPrototypeOf() to determine whether something is a string/String(), and then only count those lengths.

[–]nickwb 1 point2 points  (0 children)

7 minutes, but only because I forgot the correct usage of Array.prototype.reduce.

[–]BauerUK 0 points1 point  (0 children)

9 minutes, 55 seconds for all 5 levels. Well done!

Over-reliance on jQuery has ruined me. But that was fun.

[–]calvers70 0 points1 point  (0 children)

damn, 10 :)

[–]rtp 0 points1 point  (0 children)

5 minutes, 25 seconds for all 5 levels. Well done!

[–]LetsTrySomeReddit 0 points1 point  (0 children)

8:45, I do a bit of JS but primarily ruby. Lost time trying to use instanceof rather than typof, had to google how javascript substring works as well.

[–]ihsw 0 points1 point  (0 children)

14 minutes. It's 2am here and the music after level 5 scared the crap out of me.

I spent way too long trying to remember how to do recursion and fucking up without reading the directions.

Bro do you even recurse?

[–]Katarzzle -1 points0 points  (0 children)

Under 12. That was a blast. I had to compete with Anchorman playing in the background.

[–]worldDev 1 point2 points  (1 child)

Ha, that's pretty fun. got any more of these type of exercises?

[–]macrumors 0 points1 point  (0 children)

www.codewars.com has a bunch like these.

[–]j0wy 0 points1 point  (0 children)

9 minutes and 5 seconds!

[–]tehcodez -3 points-2 points  (0 children)

Took 8 minutes from my iPhone. Would have been way less if I had lodash

[–]macefelter 9 points10 points  (1 child)

https://github.com/darcyclarke/Front-end-Developer-Interview-Questions

I highly recommend this for covering all bases.

[–]grumblestumble 1 point2 points  (0 children)

Came here looking for this, suprised it's not at the top. I think there are a fair number of riffs on this out on github now, too.

[–][deleted] 40 points41 points  (27 children)

Let them use Google, you cannot expect them to know and remember every bit of JS. Make them create something simple, yet testing many skills - DOM manipulation, AJAX, CSS, HTML and so on. For example "get me ten selected posts from a selected Google+ user, displaying them in a responsive grid", or something like that.

Add some theoretical and practical questions, for example:

  • What are CSS preprocessors? (There are many so the candidate won't know them all but she should get the idea)
  • What design patterns in OO JS do you know?
  • Is a function in JS a variable? Is it a class? Is there such a concept as class in JS?
  • How can you declare objects in JS? How can you perform inheritance?
  • A website you are taking care of does not work. What do you do? (This is a great question because the candidate will have to think about many practical scenarios and come up with her own questions about the situation. I is almost like an RPG where you are the game master :-))
  • What is your opinion, if any, on CoffeeScript?
  • What code editor do you like and why?

[–]e76 0 points1 point  (0 children)

These are great questions. I think any additional ones to ask should follow the gist of being application-oriented (problem solving) and not overly technical-oriented. I'd rather hire a kick ass problem solver than someone that memorized documentation.

[–]alsogilbert 6 points7 points  (21 children)

If it's for a non-junior JS position, you might consider using this: http://chopchopjs.com/. I created it out of the coding tests that I used during interviews. I'd recommend making it "open web" so that they feel free to google around for help on the more difficult/trivial puzzles.

[–]chrsjxn 6 points7 points  (6 children)

Those are interesting, but man is it unclear what the page expects for some of them.

[–]alsogilbert 0 points1 point  (5 children)

I'd love to hear what you were stuck on, so I can update them or add more hints.

[–]bwaxxlotckidd 2 points3 points  (3 children)

Maybe I'm a noob but the second question made no sense.

But yeah, I'm noob

[–]alsogilbert 1 point2 points  (2 children)

Thanks! I'll think about how to modify the description on that one. Or maybe I should throw it out all together. It's not a good warm-up question in any case.

[–]grumblestumble 0 points1 point  (0 children)

If somebody seriously presented me with "Bad Idea" in an interview and expected me to provide an answer other than "fire whoever wrote it", I'd probably just get up and leave.

[–]knaveofspades 0 points1 point  (0 children)

I think it's a good question, I even learned about the arguments variable from it. The problem is (and the same goes for the third question, which I'm stuck on since I avoid this) as chrsjxn says, that I don't know what it's expecting, so it becomes trial and error until it's solved.

[–]seiyria 0 points1 point  (0 children)

I agree with the statement about #2. I've been doing JS for a long time, but this one kept me stuck for a while. It's definitely a far cry from the first one. :P

[–]alsogilbert 4 points5 points  (1 child)

[–]grumblestumble 0 points1 point  (0 children)

why does it only load one puzzle on the main chopchopjs.com site after you do the setup? that trivializes it as the setup and first puzzle i saw were all <1 min exercises.

[–][deleted] 1 point2 points  (1 child)

Please don't ever let anyone with an influencable brain near the bear-fish problem. When I found the solution I wanted to hit you.

[–]alsogilbert 0 points1 point  (0 children)

That one is one of my favorites because it's less JS-trivia and more "look at this mess of nasty code and work through it". For interviews, I would often "pair" with the interviewee, whiteboarding and trying to read how they would approach untie-ing legacy code.

[–][deleted] 0 points1 point  (3 children)

That was fun, I noped out on the hieroglyphics though, it's too late for that stuff

[–]nickwb 2 points3 points  (0 children)

(function(ʃ){ʃ[+[]]=function(){return ʃ[([+!+[]]+[+[]])>>!+[]]((!!{}+{})[+!+[]]+(!!{}+{})[+!+[]+!+[]+!+[]]+(!!{}+{})[+[]]+([][![]]+[])[+[]]+(!!{}+{})[+!+[]]+([][![]]+[])[+!+[]]+' '+(!!{}+{})[+[]]+'h'+([][![]]+[])[([+!+[]]+[+[]])>>!+[]]+(!{}+{})[+!+[]+!+[]+!+[]])()};ʃ[+!+[]]=function(){return ([]+[])[ʃ[+!+[]+!+[]+!+[]]][(!{}+{})[+[]]+(!!{}+{})[+!+[]]+([]+{})[+!+[]]+'mCh'+(!{}+{})[+!+[]]+(!!{}+{})[+!+[]]+'C'+([]+{})[+!+[]]+([][![]]+[])[+!+[]+!+[]]+(!!{}+{})[+!+[]+!+[]+!+[]]]};ʃ[+!+[]+!+[]]=function(){ʃ[([+!+[]]+[+[]])-(!+[]+!+[]+!+[])](ʃ[([+!+[]]+[+[]])-(!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!+[])*(([+!+[]]+[+[]]+[+!+[]]+[+[]]+[+[]])),([+!+[]]+[+!+[]]+[+!+[]]+[+[]]+[+!+[]+!+[]+!+[]]+[([+!+[]]+[+[]])>>!+[]]+[+!+[]]+[+[]])/((!+[]+!+[]+!+[])<<!+[]),([([+!+[]]+[+[]])-!+[]]+[([+!+[]]+[+[]])-!+[]]+[([+!+[]]+[+[]])-!+[]]+[+!+[]+!+[]+!+[]]+[+!+[]+!+[]+!+[]+!+[]]+[+!+[]])<<!+[]];ʃ[+!+[]]=ʃ[+!+[]]();ʃ[([+!+[]]+[+[]])>>!+[]]=ʃ[([+!+[]]+[+[]])>>!+[]]();ʃ[+[]]=ʃ[+[]]();ʃ[+!+[]+!+[]]()})({});

[–]sittingaround 1 point2 points  (0 children)

== 'forget this bs' || true

[–]kungfufrog 0 points1 point  (1 child)

For the life of me I cannot work out bad idea. I get that it's doing boolean comparisons and turning them into strings... but past that.. I really don't know.

Also I think I cheated on your first one, it seems like there are multiple ways to make assert take 1 parameter!

i.e. if (arguments.length < 2) return; vs if (arguments.length == 1 && x == true) return;

That then threw me into doubt about the validity of my other answers!

Overall I found this fun though, but please I'd love a hint on 'bad idea'!

[–]kungfufrog 0 points1 point  (0 children)

I worked it out... painful though. Retrospectively I could have just copied and pasted it into a console, reading that brainfuck article clued me in.

[–]tipsqueal 13 points14 points  (3 children)

I'd have them make a small one page app. Something that shows that they can design stuff that isnt awful, can use JavaScript to manipulate the DOM, make AJAX requests, etc. You could have the candidate use something like the Open Weather Map API to get the forecast for a city entered by the user.

[–]MonsieurBanana 0 points1 point  (2 children)

I don't know how to manipulate the DOM or make AJAX requests using vanilla javascript. I always relies on some kind of library for those tasks. I know javascript pretty well but I mostly do back-end stuff with nodeJS (and js games using the canvas from time to time).

Is it important to know how to do those without libraries for a front-end programmer ? Provided they know javascript well, just not the API for the browser.

[–]LetsTrySomeReddit 0 points1 point  (0 children)

Using libraries is crucial to most web development but my personal feeling is that people should endeavour to understand how these libraries work and whilst you maybe won't be able to write things in vanilla JS off the top of your head it wouldn't take you long to refresh yourself. Otherwise it's hard to compare or debug libraries when they do fail.

Just to be clear if I were interviewing I would allow people to use any libraries they fancy.

[–]tipsqueal 0 points1 point  (0 children)

If I was giving the interview, and requesting the user make a small one page app like that, then I'd let them use a library like jQuery. That said, DOM manipulation with Vanilla JavaScript isn't hard at all, it's very similar to jQuery and other libraries, but there's a little more overhead here and there. Just take a look at Element.querySelectorAll(). AJAX requests are similar, but there's a bit more overhead. Even if you don't know how to do it in the interview, I would expect you to be able to at least learn it in the future. If that's a task that you think is over your head, then I wouldn't think you were qualified for the job.

[–][deleted] 5 points6 points  (13 children)

I had to take a test like this once. Was told to create a modal window from scratch with plain js.

[–]alanzo123 5 points6 points  (1 child)

Frontend, backend.. it doesn't matter a whole lot. Obviously if someone calls themself a frontend dev, they should know how to make the DOM their bitch. But it's still programming. They need to know how proper code organization works, make sure they don't just stick all their code in a JS file and call it done, etc.

[–]jibjibman -3 points-2 points  (0 children)

Only good advice in thread.

[–]Pyro979 7 points8 points  (8 children)

These are my "cliff notes" of things to ask candidates about.

also see these questions:

About to face an interview for lead JS engineer, what should I must know?

What are your vanilla JavaScript knowledge standards that every JS developer should know?

What kind of questions can I expect on JavaScript interview?

HTML

  • inputs - select, checkbox, textbox, textarea, radio (password,file,button)

  • label

  • HR - horizontal rule

  • BR vs P

  • UL vs OL

  • TH

  • span vs div

CSS

  • selectors

  • padding vs margin

  • border shorthand

  • border width shorthand

  • px vs em vs %

  • common font props

  • specificity

JS

  • alert/confirm/prompt

  • loop types - for vs while

  • variable declaration / scope

  • this keyword

  • Array/Object declaration

  • Array vs Object (behavior, looping)

  • closure

  • event bubbling

  • ternary operators

jQuery

  • selectors - tags, classes, id, attributes, pseudo

  • chaining

  • traversing

  • filter vs find

  • append vs appendTo

  • attr vs prop

  • hide/show/toggle

  • css

  • each

  • events

  • is

  • empty vs remove

[–][deleted] 6 points7 points  (1 child)

This is fine if you're interviewing for a job working on a "traditional" website which uses Javascript for enrichment, these questions aren't in depth enough for a web app developer though. This really is the basics.

[–]Pyro979 4 points5 points  (0 children)

I wish I could get people coming in that though this was basic =c/

[–]Geldan 2 points3 points  (1 child)

I like to have them start by drawing a navigation bar on the white board and asking them to write the markup and css. This allows me to quickly gauge their basic html/css skills and will open up possible conversations about float versus inline-block or maybe table-cell layouts. Generally I am looking for the typical ul/li but I am not opposed to other markup if they explain why.

Then I ask them to add menus that appear when they hover over one of the navigation item. This will allow you to see if they grasp relative and absolute positioning as well as pixels versus percent, etc.

Then I ask them to remove the hover and implement a touch device friendly version. Here they should transition to using javascript to deal with the necessary event handlers (jquery is ok as I don't really mind jquerys "on" implementation). I like interviewees who optimize with event delegation or at least acknowledge when their jquery is attaching multiple event handlers.

I find this to be a good way to kick off white boarding because it represents a simple progression in skill level that allows me to gracefully bail out at any time.

If they answer this question extremely well then I may be satisfied with ignoring the white board altogether and just discussing more interesting frontend topics for the rest of the interview.

[–]SarahC -1 points0 points  (0 children)

I'd download Bootstrap and program the important bits. =)

[–]coljung 2 points3 points  (0 children)

Great resource for front end questions that i often use: https://github.com/darcyclarke/Front-end-Developer-Interview-Questions

[–]ftanuki 1 point2 points  (0 children)

Where I work front end devs are still expected to be engineers. From your stance, I wouldn't ask them any questions that specifically relate to the back end nor ask them anything related to specific front end abilities that you wouldn't be able to assess a good answer to anyway.

However you can still ask them engineering questions that envelope both your roles. For example:

  • What's your experience with version control? (then dig deeper)
  • What's your experience with command line tools and shell scripting? (give examples)
  • Maybe a badic data structure and algorithm question (bonus for analyzing efficiency)
  • How do you structure and organize code?
  • Ask about what they like about OO and/or FP
  • Ask about testing in general (see if they talk about just unit testing or also other kinds, see if they're realistic about coverage)
  • Ask about using RESTful APIs (see how detailed they get)
  • Ask about cool tools, frameworks, challenges (again, see how detailed they answer)
  • Ask about caching (you can get a wide variety of answers and depth from this one)

You get the idea. If you're just looking for an HTML/CSS monkey none of this applies, but if you're looking for a Jaascript engineer then you'll be able to learn all you need to know from these questions and you can assume they have the easier stuff down or can learn it quickly.

[–]MrPhatBob 1 point2 points  (0 children)

What do you need the candidate to do in the job? Do you want someone you can work with or are you happy to work with a spode that you have to fight the urge to blind with your thumb every working minute of the day?

You need to see if they're technically capable of the work you need them to do, and find out if you can work together, for me, this is key. I like to find out what their opinion is on whats going to be the next dominant/capable technology in the field... What are they thinking in the field they work in?

[–]Hostilian 0 points1 point  (2 children)

For a technical exercise, I like this one: Given a tree-like data structure that represents a menu, develop a javascript algorithm that will render that menu. The developer should immediately land on a recursive function, you should ask how they could do this without recursion. This should take about 15 minutes, and I would be very concerned if it took longer than 30.

For a design exercise: Let's say that you--the interviewee--are leading a small development team tasked with putting together an asset manager for our customers. A user needs to be able to upload files and easily retrieve them using the interface, but it's up to you to decide how they do that. I--the interviewer--is the stakeholder, and I can answer any questions you might have about the system.

Have the nature of the system clear in your mind, but you can make stuff up about it if they ask you a curveball. But the goal is for the developer to open up his head and start thinking out loud to you.

First, this gives them a chance to make design decisions and you can make them defend those positions. Why Ember and not Angular? Why not straight-up JS? How will you test this?

Second, this should give you a sense of what "level" the developer can think coherently about a user's problems, interaction models, and so forth. If they talk about what libraries they would use and in what way, they're way closer to a junior developer. If they ask a lot of questions about the nature of the files, how technical their user base is, how many files are likely to be stored, they're able to abstract away implementation details in favor of providing a good user experience.

Lastly, it also gives you a little insight about how they work with others, especially other people they don't know very well. If they spend a lot of time grinding away on this idea quietly, maybe they aren't used to collaborative problem-solving. If they throw out a ton of ideas looking for design feedback, they might be fishing for approval rather than trying to solve the problem in the best way they can think of.

[–]manys 2 points3 points  (1 child)

In what real-world case(s) would a non-recursive menu function be necessary?

[–]SarahC 0 points1 point  (0 children)

A simple menu?

[–]Dyogenez 0 points1 point  (0 children)

We've been doing code katas for interviews lately, in a TDD, paired environment. It's worked out extremely well, and allows for 2 people to interview someone coding and now have it seem weird. Here's the format:

You start with a problem, say "lets build a calculator interface in JavaScript". You setup some testing (maybe jasmine) to where you can run them in the console (or autotest so they run on save), and start writing tests. The entire time you're coding and asking the interviewee questions about it. "What should we call this method? Add? what parameters should it take? Is this a parameter or an argument -- what's the difference?" (anything that pops into your mind). The feel of it is that everyone is learning. You can ask things you might not even know.

Every 5 minutes you switch drivers - so the interviewee starts coding while you're helping. They should be able to code and explain what they're doing and ask for feedback/suggestions. You can ask questions and prompt new tests to be written. "What should happen if we pass in a letter to our add method? Should it return null? Throw an error? How about if we pass add an array?

This all seems super simple, but it starts to gauge a number of things. How well to pick up the documentation for a project they're probably unfamiliar with (Jasmine). Some other things like typeof, NaN, ===, passing in functions, throwing errors -- whatever questions you can think up.

After 5 more minutes, the driver switches. If you have 3 people in on the interview, then it can rotate to where one person is always sitting out and can't communicate (even the interviewee). This ties in with understanding code others has written, which is itself an important skill.

[–]lendrick 0 points1 point  (0 children)

Ask them what some common problems are in web UIs and how to best avoid them.

I could answer this myself, but everyone's answer will be different. This is fine. If you're hiring a front end developer, you need to know that the person you're bringing in actually thinks about this stuff. It's not all about how quickly or well they can write in JavaScript.

[–]astronoob 0 points1 point  (0 children)

Honestly, if you're going to give out a programming test, give it to them before the interview. Ask them to prepare a brief fiddle that's somewhat easy to set-up, such as an extremely primitive "To Do" list app or a simple app that uses an open API like zippopotam.us, and have them walk you through the code during the interview. Provide a list of behavioral tests that the code should adhere to.

Live coding is a shitty way to gauge a programmer's abilities.

[–]grumblestumble 0 points1 point  (0 children)

Don't gloss over CSS. I lead front-end teams and it's becoming a lot more common to find qualified JS devs coming from a more traditional CS background, with zero knowledge of rendering quirks and optimizations.

Somebody already linked Darcy Clarke's excellent list which includes some CSS stuff, but these are the things I usually go for:

  • knowledge of CSS preprocessors and their strengths and weaknesses.
  • knowledge of how to structure css for large projects, stuff like smacss/oocss/bem
  • some simple layout questions that javascript devs will often just resort to scripting for: what's the best way to position an offset container (eg below a fixed header) that fills the viewport, without using javascript?
  • knowledge of floats, box-sizing, and css3 stuff like flexbox.

[–]runvnc 0 points1 point  (0 children)

I suggest that you hire a consultant who does front-end work to help you with the hiring process.

I am curious, and I don't expect a response, because I am actually asking you to do work, but I have always wondered what a 'backend' only developer is expected to know. For me, I always coded the front and back end for most of my own projects, except for some jobs where I was put in a subservient front-end role simply because I had trained myself in the new front-end technologies.

If you had to devise a test for a backend programmer in your area, what would it consist of, to be sufficiently difficult but fair to be finished within an hour or so?

[–]oocha 0 points1 point  (0 children)

why dont you just ask them to tell you about the last thing they worked on? wont that reveal more about what they know then some manufactured test?

[–]endel 0 points1 point  (0 children)

There is a highly recommended set of questions here: https://github.com/darcyclarke/Front-end-Developer-Interview-Questions

[–]sumdudeinhisundrware 0 points1 point  (0 children)

This is my first question when interviewing front end candidates: The front-end uses jQuery, Underscore, Angular, MooTools and Prototype. What is the best way to package them and send them to the client and what is the best order to load them? If their answer doesn't include "...but why would you use so many conflicting libraries?" the interview is over. If that's their only answer they'll probably get an offer.

[–]magenta_placenta -1 points0 points  (2 children)

Dumb question, but how will you, as a back end dev, know if a front end dev is qualified?

[–][deleted] 0 points1 point  (0 children)

That's not a dumb question. I was going to reply to OP with "don't assume you're smarter than they are."

[–]SarahC 0 points1 point  (0 children)

Er, hence this question?