56 questions across 13 categories, each with a short answer, a deep explanation, a code example, a common wrong answer, an interview trap, and a follow-up question.
Fundamentals easy What is the difference between var, let, and const? +
Fundamentals easy What is the difference between == and ===? +
Fundamentals medium What is hoisting? +
Fundamentals easy What is the difference between null and undefined? +
Fundamentals medium What are some surprising results of the typeof operator? +
Functions easy What is the difference between a function declaration and a function expression? +
Functions easy How do default parameters work in JavaScript, and when are they applied? +
Functions medium What is the difference between rest parameters and the arguments object? +
Functions medium What makes a function 'pure', and why does it matter? +
Scope medium What is lexical scope? +
Scope easy What is block scope, and how did let/const change JavaScript's scoping model? +
Scope medium What is global scope pollution, and how do modules help avoid it? +
Scope hard What is the temporal dead zone (TDZ)? +
Arrays easy What is the difference between map and forEach? +
Arrays easy What is the difference between splice and slice? +
Arrays medium What is an 'array-like' object, and how do you convert one to a real array? +
Arrays medium What do flat() and flatMap() do? +
Objects medium What is the difference between a shallow copy and a deep copy? +
Objects medium What does Object.freeze() do, and what are its limitations? +
Objects easy What are computed property names in object literals? +
Objects hard What is a property descriptor, and what does Object.defineProperty enable? +
DOM medium What is the difference between event bubbling and event capturing? +
DOM medium What is event delegation, and why is it useful? +
DOM hard What is the difference between a browser reflow and a repaint? +
DOM easy What is the difference between querySelector and getElementById? +
Async medium What problems do Promises solve compared to plain callbacks? +
Async medium What is the difference between async/await and .then() chaining? +
Async medium What is the difference between Promise.all and Promise.allSettled? +
Async hard What is a race condition in asynchronous JavaScript, and how can you avoid one? +
Async medium How should errors be handled in async/await code? +
Event Loop easy What is the call stack, and how does it relate to a 'stack overflow'? +
Event Loop hard What is the difference between microtasks and macrotasks? +
Event Loop medium Why doesn't the browser UI freeze while waiting for an async operation like fetch? +
Event Loop medium What is the difference between requestAnimationFrame and setTimeout for animations? +
Closures medium What is a closure? +
Closures medium How can closures be used to create private variables? +
Closures hard Why do closures created inside a var-based loop often reference the same value? +
Closures hard Can closures cause memory leaks? +
this medium How is `this` determined inside a regular function? +
this medium How does `this` behave differently inside an arrow function? +
this medium What is the difference between call, apply, and bind? +
this hard How does `this` behave in class methods, and why do class methods often need to be bound? +
this medium Give a concrete example of 'losing this context' and how to fix it. +
Prototypes medium What is the prototype chain? +
Prototypes hard What is the difference between __proto__ and .prototype? +
Prototypes hard What does Object.create() do, and how is it different from using `new`? +
Prototypes medium Are ES6 classes a fundamentally new inheritance model, or syntax over prototypes? +
Performance medium What is the difference between debounce and throttle, and when would you use each? +
Performance medium What is memoization, and what are its tradeoffs? +
Performance medium What problem does a 'virtual DOM' (as used by React) actually solve? +
Performance hard What are common causes of memory leaks in browser JavaScript, and how do you avoid them? +
Algorithms medium What is the time complexity of common array and object operations? +
Algorithms medium What is the two-pointer technique, and when is it useful? +
Algorithms medium When would you choose recursion over iteration, and what are the tradeoffs? +
Algorithms hard What are the tradeoffs between common sorting algorithms like bubble sort, merge sort, and quicksort? +
Algorithms medium When should you use a Map instead of a plain object for key-value storage? +