Answering tricky JavaScript interview questions

preview_player
Показать описание
We all work in our respective silos when writing JavaScript, be it a framework or library. After a few years working as a Front-end dev, I looked at a list of "JS interview" questions and realized that I couldn't answer many of them (at least not well). So I set out on a long, somewhat lonesome journey of JS discovery, and am pleased to share my findings with you, in the form of a talk.

Regardless of how you feel about getting asked random questions meant to trick you up in an interview (you should be appalled), my talk will cover some basic JS subtleties, and hopefully fill in some knowledge gaps w/r/t:
- Hoisting and variable scope
- Expressions v. statements
- Undeclared v. undefined v. null
- Equality comparisons
- How to properly walk out if an interviewer asks you to do fizz buzz

This talk was given at Nodevember 2016 by Russell Anderson.

This talk is under the creative commons license. freeCodeCamp is not associated with this talk. We're just excited to bring more exposure to to it!

--

Рекомендации по теме
Комментарии
Автор

32:21 nailed it! if you're getting an interview that is completely based on knowing terms and techniques of the tools, run to the nearest exit. Usually a sign that the interview panel doesn't have a grasp on delivery and is focused on tools.

utubewatcher
Автор

00:00 Introduction
00:19 About Russell Anderson
01:57 Inspiration for the talk
02:22 Brad Frost's responses to HTML5 Boilerplate frontend developer interview questions
03:54 Are interview questions a good idea?
04:48 Explain event delegation
05:59 Describe event bubbling
06:30 How event bubbling and delegation works in practice
08:05 What's the difference between "target" and "currentTarget"
08:35 Explain why function foo(){}() doesn't works as an IIFE
09:16 Explain the difference between writing a function as a statement and an expression
12:14 Why in general is a good idea to leave the global scope of a website as-is and never touch it?
13:17 Explain "hoisting"
18:13 What do we do with the knowledge of hoisting?
19:22 What is the difference between a variable that is null, undefined or undeclared?
26:36 What is the difference between == and === ?
28:25 You are hired!
28:52 Closing remarks
30:32 Questions and Answers

webboss
Автор

Nice to know that I'm not the only one to find this kind of questions often, not so relevant to spot a good dev.

simoneicardi
Автор

Nice talk.. 👍👍 learning JavaScript and loving it

VikasKM
Автор

Let and const are hoisted, they just don’t have a default value, like var does (undefined).

aeconomopulos
Автор

I'm sure this is a cool video, but can the thumbnail be updated to match the person speaking?

franksonjohnson
Автор

Very good presentation, I learn a lot. Maybe sameone have a link for this list of questions which was on the 28:46?

rafafoltynski
Автор

5:00 start from here to save you some time ;)

DarrewIP
Автор

In lieu of random technical questions, I would love the opportunity to go into detail in any one of my projects---some of which are open source. While discussing the code, you'll get technical know-how right alongside how I came up with solutions to situations. Let's not interview; let's code!

KeithDCommiskey
Автор

correction:
let foo=null
typeof foo // return "object" as string 😀

someone
Автор

You question for hoisting your answer is incorrect, kindly check it again, it will not throw any error

niteshtak
Автор

Why is nobody saying anything regarding ==(allows implicit coercion) and ===(does not allow coercion) ?!

corpodeanandrei
Автор

"so you wanna be a chef here ? tell me how to write a cookbook then ..."
"im a chef not a writer i can cook if you want"
"ok i dont think youre right for us "
thats how dumb coding interviews are

myname-mzlo
Автор

this was very informative thank you, i learned a lot.

hassanbenhajbouih
Автор

The definition of hoisting is completely inaccurate here. Nothing is "declared / moved to the top" as many sources claim.

krisztiankugler
Автор

Why do really religious people always bring up that they are religious whenever they give a talk on a completely unrelated topic?

sphptjv
Автор

These interview questions are only going to get worst and harder because of the amount of devs available now a days smfh.

ThemKlips
Автор

Don't use double equals! Thank me later

elkiaora
Автор

I'm Muslim. I been developing software and web application since 15

yorumcuturk
Автор

The title is deceptive. Turns out the most basic javascript questions are considered “tricky” by this guy. I started watching this video with completely different expectations as of what “tricky” constitutes.

IsayanBros