
Front End Developer – Interview Questions - shridhad
https://github.com/h5bp/Front-end-Developer-Interview-Questions
======
steakejjs
This looks like a giant list of trivia that has almost no bearing on the day-
to-day effectiveness of the candidate.

For example, I don't have the slightest clue what the answer is to probably
half of these and a lot of my job is to write javascript that gets run
millions to billions of times a day. The "code questions", by contrast, were
all ridiculously easy.

So, would it really matter if you are hiring someone who doesn't remember the
difference between .call and .apply off the top of their head?

~~~
cozuya
Call and apply are core concepts to writing good javascript. I would not hire
someone (at least for any sort of senior role) that could not tell you exactly
how both of them work. Many of the other things on this page are certainly
"trivia" that could be addressed by google when they come up, but not those.

~~~
driverdan
How often do you use call and apply? I've been a JS developer for a long time,
have written a lot of JS code, and rarely need to use call and apply.

Unless you're writing all your code from scratch and not using any frameworks
/ util libs (which you should) you won't need them very often.

~~~
nogridbag
Agreed I can't even recall the last time I used call or apply. We might have
only a handful of cases out of roughly 200,000 JS lines of code.

~~~
dustingetz
Perhaps that is why y'all have 200k LOC of javascript :)

------
drinchev
I know this repo. I've used it a lot of times while interviewing front-end
developers.

I would give anyone using it a tip of advice :

Use this list not as a TOC or a check list. Use it to remind yourself what you
could actually talk with the person that is applying for a job.

I usually start with the questions and present them not as a real question,
but as a more of a "topic of conversation". Like for example :

Question => Transformed into topic

"Which version control systems are you familiar with?" => "Have you used VCS
on your previous job? Which VCS is your favourite?"

"Name 3 ways to decrease page load (perceived or actual load time)." => "Have
you ever tried to improve google page speed index or your page speed at all?"

Next I will ask in a similar ways questions about HTML, CSS and so on. I could
go deeper if I see a person is interested in what we are talking about.

Anyway I've been interviewing more than 10 persons with this list in front of
me. I highly recommend it as a base of your interview.

------
forrestthewoods
As an interviewee: "This is what I've in my career. If you'd like to give me
money then I can do those things for you."

As an interviewer: "Tell me what you've done in your career. We'd like to give
you money to do those things for us."

That's all I really want or need for either side of the table.

~~~
cozuya
Without asking technical questions, how would an interviewer weed out the
people who say the former but can't actually back it up? Because if the above
is the entire hiring process, your junior developers aren't going to have to
be concerned about their imposter syndromes, because they'll be working along
side actual imposters.

~~~
EC1
Employment probation. We fired a few people right off the bat within 3 months
because they very clearly bullshitted us. One guy fucking used notepad to
code. I'm not joking.

~~~
nkangoh
What exactly is wrong with using notepad to code? No syntax highlighting?

~~~
Bahamut
Aside from all the helpers other editors for code give, Notepad adds a BOM to
the UTF-8 encoding, which can screw up html files and more.

------
ritchiea
Anyone else feel like there is a lot of esoteric information here? For
instance:

> Are there any problems with serving pages as application/xhtml+xml?

I've never had to or considered serving pages as application/xhtml+xml,
there's no reason for me to know the answer to this question and I've been
working on the front end for ages. If I ever had reason to serve a page
application/xhtml+xml I would thoroughly research it. Although I would say the
JS questions look decent.

~~~
habith
> I've never had to or considered serving pages as application/xhtml+xml,
> there's no reason for me to know the answer to this question

I think VML's response is valid here, it's to check for experience and if you
were engaged enough with the happenings of the web at the time.

Background (not a 100% accurate, I'm writing from my admittedly poor memory):

XHTML and later XHTML2.0 were being pushed a while ago (early 2000s) as the
next HTML language (succeeding HTML 4). At some point the community split and
people from Mozilla, Apple and Google (I think) formed WHATWG to pursue a
different (and faster) direction which is where HTML5 was formed, then later
adopted back by the W3C.

One of the issues at the time when people pushed for wide XHTML adoption was
that most people served pages as text/html which was basically wrong.

Serving pages as application/xhtml+xml triggered the XML parser instead of the
HTML parser which is the "proper" way to parse XHTML.

The problem some people ran into was that the XML parser is way less lenient
than the HTML parser. You _have_ to close your tags, you _have_ to escape
entities, and if you had a single mistake anywhere in your markup the browser
would render an error page instead of working around it.

There were also issues with in-lining JavaScript and having to wrap it in a
CDATA block to stop the XML parser from attempting to parse it.

This was a headache for sites with user generated content and people in
general seemed to not like the idea of having to clean their markup for what
some perceived as very little gain.

Anyway, long story short, HTML5 won, XHTML didn't.

~~~
ritchiea
Makes sense I don't know any of this, I was in high school in the early 2000s.

------
tall
I don't really care for this style of interviewing. A technique that really
works is to take a problem the company is currently facing, slim it down and
present it to the candidate pre-interview. Then when he comes in you ask him
to explain his solution, and the choices he made.

It allows the candidate to be far more relaxed and puts him in a situation a
lot more akin to the work that he will be doing for your company.

~~~
shittyanalogy
It's also kind of sleazy as you're getting them to do work for you for no pay.
I've been in interviews where similar questions were asked, and they had me go
into more detail as I was actually solving problems for them.

~~~
teh_klev
Less sleazy would be to ask them to solve an already solved problem (whether
you tell the candidate it's already solved or not is up to you).

------
peteretep
"Can you say 'CSS specificity' without jumbling it up, first go?"

------
mkoryak
I really like this js question (whiteboarding):

Implement function foo which takes an integer size, and returns an array of
that size where each element in that array is a function that returns the
index of that function in the array. Testcase: 42 === foo(1000)[42]()

There are 3 different correct solutions. Discuss which solution is better,
worse... etc (if they get there)

(could probably be worded better, I'm not an english major)

~~~
speg
I feel bad, because as I was writing a solution to this I knew why it wouldn't
work and why (returning my counter variable returns the value at the end of
the count) but I still couldn't come up with a fix :(

Edit: A good Google seems to suggest using JSON.stringify and JSON.parse to
copy the value.

Edit 2: But even that doesn't seem to work :(

Edit 3: Got it, using a generator function. Which makes sense. I guess I'm not
an expert yet! :)

~~~
b3tta
Using a closure:

    
    
      function foo(s) {
        function generator(i) {
          return function () {
            return i;
          };
        }
    
        var r = new Array(s);
        
        for (var i = 0; i < s; i++) {
          r[i] = generator(i);
        }
        
        return r;
      }
    
      console.log(foo(1000)[42]());
    
    

Using Function.prototype.bind():

    
    
      function foo(s) {
        function generator(i) {
          return i;
        }
    
        var r = new Array(s);
        
        for (var i = 0; i < s; i++) {
          r[i] = generator.bind(window, i);
        }
        
        return r;
      }
    
      console.log(foo(1000)[42]());

------
freshyill
This has been around for a few years and it's due for some major updates. The
CSS questions are becoming very, very dated.

> Have you played around with the new CSS Flexbox or Grid specs?

Flexbox is well past the point where you should be "playing around" with it.
It's time to straight-up learn it, if not start using it in production. It's
ready. And if that leads you to the question of "well what about crappy old
versions of IE?", well there's another interview question for you.

Only one question about preprocessors—and a vague one at that? Not even a
mention of things like Grunt and Gulp, pattern libraries, style guides, or
even the terminal?

This stuff is integral, not optional, these days.

I interviewed a lot of people last year for a senior front-end position that
we never ended up hiring for. We made a few offers that fell through but for
the rest, I would have ended up teaching them how to do the bulk of the job
had we hired them.

~~~
wil421
>It's ready. And if that leads you to the question of "well what about crappy
old versions of IE?", well there's another interview question for you.

So what is the other interview question?

I really haven't dove into flex box because I am stuck supporting IE 9 on both
of my projects. If I were to try and implement it on one of these projects it
would be a wasted effort when 90% of my users are still using IE 9 on their
corporate Dells.

How do you learn and develop new skills if your stuck supporting older
browsers?

~~~
freshyill
> So what is the other interview question?

The question would be "how do you handle browsers that don't support flexbox?"

My answer would be to use Modernizr to detect lack of flexbox support and
write some fallback styles.

If you're supporting an extremely higher than average percentage of users on
IE 9, then it's worth basing decisions on this fact. Globally IE 9 accounts
for 2.13% of usage and that number isn't going up.

There's no way to really learn this stuff other than to just start doing it.
Just write fallback styles to support crappier browsers and remember that
pixel-perfect designs across browsers was _never_ a realistic goal.

------
FabianBeiner
Lets imagine the two worst case scenarios here:

1st: A company asks those questions because they don’t know better. Someone is
good at remembering stuff and does so. He gets the job.

2nd: A company asks those questions because they don’t know better. Someone is
a good developer but fails at these questions – with no specific reason. He
doesn’t get the job.

~~~
cozuya
While there's definitely a lot of useless trivia (worse, useless trivia from
5+ years ago that no longer applies at all) in this list, the good parts of
these questions _are the job_. If you don't know how to answer the relevant
questions in this list, you aren't a good developer. There is currently an
explosion of "front end developers" who don't know anything at all beyond
"here's where I put in the bootstrap class to make the page look right" and
"here's where I put in the angular expression" (or jquery plugin). Asking
questions like this weeds them out.

~~~
FabianBeiner
1st scenario.

------
abrahamepton
These questions make me angry by being so fucking dumb. No I don't know off
the top of my head what splitting on an empty string does and if you give a
shit whether I do that tells me all I need to know about whether I want to
work for you.

------
AustinG08
Man, the hardest questions for me to answer was the first one: "what did you
learn yesterday/this week"? I do so much reading and research in my free time
and then to realize how hard it was for me to summarize what it was exactly
that I learned. Maybe I just read this stuff for the short term stimulation.
When it comes to comprehension and retention maybe I'm not getting out of it
what I thought I was. Maybe I should start asking myself what I just learned
after everything I read and take some notes o_O

------
ivanhoe
IMHO this can go as an example of a totally wrong way to formulate questions.
Interview questions should be about the general concepts, not the tiny
details, leave that for quiz shows. You want to know if the person understands
how things work, not to test her memory. People can always google out the
details that they can't remember, as long as they know what to do with this
info...

------
shawndumas
The 'make this work' examples are kinda silly, no?

    
    
        var add = function (x, y) {
          return (
            y !== undefined ?
              x + y :
              function (z) { return x + z; }
          );
        };
    
        var duplicate = function (a) {
          return a.concat(a);
        };

------
scelerat
A few selections from this list might make up a fraction of a phone screen,
not so much a full in-person interview.

But it's a good list of things frontend developers should know, nevertheless.

------
ArtDev
This one is a joke right? "What's your favorite feature of Internet Explorer?"

~~~
insin
Alt+F4 or "the X button", shurely?

(I'd probably answer with HTAs - handy, compact way to distribute small JS-
based tools/apps if you work in a Windows-based office and can eat the IE9
restrictions)

------
elwell
> i'm a lasagne hog

I think you meant: "i'm a lasagna hog"

------
bhhaskin
Not a bad list of questions. I think I will use some of these.

~~~
pacofvf
just avoid the fizzbuzz questions, they aren't a good benchmark for good
developers.

~~~
throw_away
fizzbuzz isn't meant as a benchmark for good developers, it's meant to weed
out the obviously bad.

~~~
mcgaffin
Yes, exactly. I wouldn't hire someone because they can implement fizzbuzz, but
if someone fails to implement fizzbuzz I can't imagine that I would want to
hire them.

------
jrm2k6
Is there anything like that for Android developers?

------
CountHackulus
Turns out that most of these questions can be answered with just "arson", and
I might even consider giving a further interview to someone that actually did.

------
avinassh
Any similar resources for back end devs too?

~~~
shridhad
One that I am aware of is
[https://www.reddit.com/r/programming/comments/2t227g/front_e...](https://www.reddit.com/r/programming/comments/2t227g/front_end_developer_interview_questions/)

