JavaScript Interview Guide: Core Concepts and Questions
Most JavaScript interview questions come back to a few ideas: how the engine runs code, how scope and closures work, and how asynchronous code is scheduled. This guide starts with those and then moves to objects, classes, promises and modules.
Each lesson is traced step by step with real output, and the question-bank lessons at the end let you practise answering out loud.
Who it is for: Developers who use JavaScript every day but want to explain it clearly in interviews.
22 lessons · Published by Jainik · Last updated
1. How JavaScript runs your code
- 1. JavaScript Core · 12 minHow JS Works: The Execution Context
Everything in JavaScript happens inside an execution context. How the global one is created — memory phase first, then code phase — and why that order explains almost everything that follows.
- 2. JavaScript Core · 12 minThe Call Stack
JavaScript can only ever do one thing at a time. This is the structure that decides exactly what runs right now, what's paused and waiting its turn, and what happens the moment a function calls itself one time too many.
- 3. JavaScript Core · 11 minScope Chain and Lexical Environment
Lesson 4 showed one function looking outward to Global. This lesson extends that into a full chain — as many levels deep as your code is nested — and gives it a proper name: lexical scope, decided entirely by where you physically wrote your code, never by which function called which.
- 4. JavaScript Core · 18 minlet, const, var and the Temporal Dead Zone
The full picture of the three declaration keywords: every axis they differ on, function scope versus block scope (and what loops do), exactly where the TDZ starts and ends and why it is temporal rather than positional, the places it hides, redeclaration, errors that stop your file before it runs, and the one exception to "typeof is always safe".
- 5. JavaScript Core · 16 minJS Engine and V8 Architecture
Parser, interpreter (Ignition), compiler (TurboFan), memory heap and garbage collection — what the engine does between your file and the CPU. Watch a function climb V8's tiers and fall back on a deopt, and step through mark-and-sweep.
2. Closures and functions
- 6. JavaScript Core · 13 minClosures
A function that remembers where it was born — even after the place it was born in is gone. This is the one exception to "popped execution context = memory freed" that Lesson 2 promised we'd come back to.
- 7. JavaScript Core · 12 minsetTimeout and Closures: The Interview Classic
One loop, one setTimeout, one wrong answer almost everyone gives the first time. This lesson is dedicated entirely to the single most-asked closures question in JavaScript interviews — and four different, genuinely correct ways to fix it.
- 8. JavaScript Core · 14 minFirst-Class Functions, Callbacks and Event Listeners
Functions as values: passing them as arguments, returning them from other functions, sync vs async callbacks stepped side by side, and attaching and removing event listeners without leaking memory.
3. The event loop and async code
- 9. JavaScript Core · 20 minAsync JS and the Event Loop
Call stack, Web APIs, callback queue, microtask queue and the event loop that ties them together, stepped tick by tick — plus async/await, where rendering fits, starvation, and why setTimeout(0) is not 0.
- 10. JavaScript Part 2 · 30 minPromises and async/await From the Ground Up
Promise states, microtask order, a promise built by hand, async/await, the combinators and AbortController.
- 11. Full-Stack Questions · 36 minAsync JavaScript, Promises and the Event Loop
Order puzzles in the browser and Node, promise rules, combinators, concurrency limits, cancellation, race conditions and async memory leaks.
4. Objects, this, classes and modules
- 12. JavaScript Part 2 · 25 minObjects and the Prototype Chain
Property descriptors, how lookup walks the prototype chain, new traced step by step, shadowing, freeze and seal.
- 13. JavaScript Part 2 · 25 minthis, call/apply/bind and Classes
The four rules for this, arrow functions, call, apply and bind, and classes shown as sugar over prototypes.
- 14. JavaScript Part 2 · 30 minModules: ES Modules, CommonJS, Bundlers and Tree Shaking
Live bindings versus copies, Node's module rules, circular imports, and a real bundle built with esbuild.
- 15. JavaScript Part 2 · 28 minIterators, Generators and Symbols
The iteration protocol, writing iterators and generators by hand, lazy sequences, async iterators and symbols.
- 16. JavaScript Part 2 · 30 minErrors, Proxy, Reflect, Copying and Immutability
Throwing and catching, Proxy traps with Reflect, shallow versus deep copies, structuredClone and immutable updates.
5. Numbers, text and memory
- 17. CS Foundations · 16 minFloating Point: Why 0.1 + 0.2 Is Not 0.3
IEEE 754 doubles with bit-level demos, rounding, safe integers, comparing floats and handling money.
- 18. CS Foundations · 20 minUnicode, UTF-8 and Strings That Lie
Code points, UTF-16 code units, bytes and grapheme clusters, why emoji lengths surprise you, normalisation and safe truncation.
- 19. JavaScript Part 2 · 22 minMemory, Garbage Collection and WeakMap/WeakRef
Reachability, five usual leaks measured, WeakMap and WeakRef, typed arrays and how to find a leak with heap snapshots.
6. Practise the questions
- 20. JavaScript Core · 30 minCore JavaScript: The Last-Minute Recap
All 14 lessons, compressed into one read for the morning of an interview — concept, a runnable example with its real output, and a ready-made spoken answer for each, plus an output-prediction drill and rapid-fire Q&A.
- 21. Full-Stack Questions · 39 minJavaScript Core Interview Questions
Types and coercion, prototypes, classes, this, copying, Map and Set, iterators, modules, newer array methods and “what does this print” puzzles.
- 22. Full-Stack Questions · 35 minJavaScript Coding Round: Polyfills and Utilities
Tested solutions for debounce, throttle, curry, memoize, deep clone, promise polyfills, a pool, an event emitter, an LRU cache and live-coding tips.
More reading orders are on the guides page, and every series is listed on the home page.