Awesome
JavaScript Job Interview Questions
This repo contains a number of JavaScript interview questions that can be used for interview prep or when vetting potential candidates.
Some suggested answers along with relevant resources are posted in the answers folder. You can also submit answers to questions as a contributor.
Table of Contents
- General Questions
- Architecture & Patterns
- Browser & DOM
- ES6
- Functional & Asynchronous Programming
- Tricky Questions
- Best Practices & Optimization
- Algorithms & Data Structures
- CSS & UI
- React & Redux
- Angular
- Angular2
Getting Involved
General Questions
- What is a closure?
- Is JavaScript block-scoped or function scoped?
- Is JavaScript a compiled or interpreted language?
- What is function hoisting? Provide some examples where it can be good or bad.
- What is type coercion and when is it useful or dangerous.
- What is the difference between == and ===.
- What is the difference between call, apply, and bind?
- What is the difference between encryption and hashing?
- Is JavaScript static or dnyamic? Is it strongly or weakly type?
- What is the difference between progressive enhancement versus graceful degradation?
- What is object serialization and deserialization. Give examples.
- Does JavaScript use mixins?
- What is tree shaking in JavaScript?
- What is reflection? Can you give examples of reflect methods you've used in the past?
- What is the V8 engine? Is the V8 engine written in JavaScript?
- CommonJS vs AMD vs ES2015, what are the differences and which one do you prefer and why?
Architecture & Patterns
Browser & DOM
- What are the differences between window and document in the browser?
- What is a host object? How is it different from a native object?
- What is the difference between event bubbling and event capturing?
- What is browser detection? How is it different from feature detection? Give examples of when you would use them.
- What is Shadow DOM?
- How is the DOM different from BOM in JavaScript?
ES6
- What is the Temporal Dead Zone?
- Arrow functions are cool in ES6. When should you NOT use arrow functions. Name three or more cases.
- What is a trampolined function? What is it used for? Will we still need this technique with ES6?
- What is a symbol in JavaScript? Is it a primitive? What's a typical use case for a symbol in ES6?
- What is the difference between Map and WeakMap in ES6?
Functional & Asynchronous Programming
- What is a callback?
- What is a generator?
- What is a thunk in Javascript?
- What is the event loop in Javascript? How does this differ/compare to some other languages?
- What is a race condition?
- Are there any differences between a thunk and a promise?
Tricky Questions
- What is the value of
console.log(+'meow')
? Explain your answer. - What does
3 instanceof Number
evaluate to? True or false? Explain your answer. - Why is my import statement not working in the browser?
- What is the difference between an array literal and condensed arrays?
- What does it mean to "hydrate" an object in JavaScript?
Best Practices & Optimization
- Why is eval() considered evil and dangerous?
- What is meant by 'repaint and reflow'? How does it affect your application?
- What is currying?
- In TDD what is the difference between a spy, mock, and stub?
- What's the difference between (visibility: hidden) and (display: none)? Which is better for your website's performance?
- What are memory leaks? What are the most common leaks in your JS code?
- What are the differences between graceful degradation and progressive enhancement? Can you give examples?
Algorithms & Data Structures
Graphs, Trees and Binary Search Trees
- How can you check if a tree is a binary tree?
- What is the difference between traversing a tree breadth first and depth first?
CSS & UI
React & Redux
#Contributors
This repo is currently maintained by AJ Zawawi
Contributors: Daniel Chang