JavaScript Interview Questions: The Topics That Actually Come Up
JavaScript interviews focus on a predictable set of topics: closures, the event loop, 'this', promises, prototypes, hoisting, and == vs ===. Here's the topic map with what to know for each.
JavaScript interviews are more predictable than they feel: they draw from a recurring set of topics — closures, scope and hoisting, this, the event loop, promises, prototypes, and == vs === — plus a few practical coding challenges like implementing debounce. Know this set deeply and you’re ready for most front-end and full-stack JavaScript rounds.
This is the topic map, with what to know and where to go deeper for each. Pair it with the broader coding interview roadmap for the data-structures-and-algorithms side.
The concept topics
Closures (the most-asked)
Be able to define a closure, explain the scope chain, and predict the output of a counter or the classic var loop. This is the #1 JavaScript interview concept.
Scope and hoisting
Block vs function scope, the temporal dead zone, and why var surprises you. See var vs let vs const. Often tested via “what does this log?” questions.
The this keyword
The four binding rules and how arrow functions differ. Expect “what is this here?” across different call sites. See the this keyword.
The event loop, promises, and async/await
Explain the call stack, microtask vs macrotask queues, and predict the output ordering of mixed setTimeout and promise code. See promises and async/await. A guaranteed topic for modern roles.
Prototypes and inheritance
How objects inherit via the prototype chain, and what class does underneath. Be ready to explain prototypal vs classical inheritance.
== vs === and coercion
Why === is the default and how coercion produces surprising == results. Part of common JavaScript mistakes.
ES6+ features
Destructuring, spread/rest, arrow functions, and the rest of the modern toolkit — interviewers expect fluency.
The practical coding challenges
Beyond concepts, you’ll often be asked to implement something that proves you understand them:
- Debounce and throttle — rate-limiting functions (uses closures +
this). - Polyfill an array method — write your own
maporreduce. - Flatten a nested array — recursion or reduce.
- Deep-clone an object — recursion and reference handling.
- Build a simple promise — proves you understand the async model.
this, the event loop, prototypes — far more than syntax. If you can both explain these and predict code output involving them, you're ahead of most candidates.
A focused prep checklist
- Explain closures,
this, the event loop, and prototypes out loud, clearly. - Predict the output of tricky scope/async snippets.
- Implement debounce, throttle, and a polyfilled array method from scratch.
- Review common mistakes and
==coercion. - Do the coding interview roadmap for the DSA round.
Where this fits
JavaScript interview prep sits at the top of the JavaScript roadmap (the internals) and connects to the general coding interview roadmap for algorithms.
The concepts and the implement-from-scratch challenges are worked through in the job-ready JavaScript in Three Months, and the harder senior/staff material — engine internals, performance, advanced async — is in JavaScript for Staff Engineers.
Know the topic map, explain each concept clearly, and predict the output — that’s most of a JavaScript interview won.
Frequently asked questions
What topics come up most in JavaScript interviews?
The recurring topics are closures, scope and hoisting, the 'this' keyword, the event loop and asynchronous code (promises, async/await), prototypes and prototypal inheritance, == vs ===, and modern ES6+ features. Most front-end and full-stack JavaScript interviews draw heavily from this set, plus practical coding like implementing debounce.
What is the most asked JavaScript interview question?
Closures are the single most-asked JavaScript concept, often paired with scope and the classic 'loop with var' output question. Interviewers use closures to test whether you truly understand how scope and functions work, since they underpin so much of the language.
How do I prepare for a JavaScript interview?
Master the core concepts — closures, this, the event loop, promises, prototypes — until you can explain each clearly and predict code output. Combine that with data-structure and algorithm practice for the coding round, and practise implementing common utilities like debounce, throttle, and array methods from scratch.
What coding challenges are common in JavaScript interviews?
Common practical challenges include implementing debounce and throttle, polyfilling array methods like map or reduce, flattening nested arrays, deep-cloning objects, and building a simple promise. These test whether you can apply the core concepts, not just define them.