JavaScript
The ECMAScript language, from values and types up to modules, memory, and the V8 engine. Frontend, backend, and full-stack interviews all test this layer — frameworks and runtimes are built on it.- 28
- chapters
- 183
- questions
- 48
- core
- 1088
- flashcards
- Covers ECMAScript through ES2026, plus Stage 4 proposals shipping in ES2027; V8 as the reference engine.
- 183 not yet reviewed
- Last verified October 2026
01How JavaScript runs8 questions
What JavaScript is made of — the specification, engines, and hosts — how features get added, and the two kinds of source code it runs.- What's the difference between ECMAScript, JavaScript, an engine, and a host?
- How does a feature become part of JavaScript?
- Is JavaScript compiled or interpreted?
- What's the difference between a script and a module?
- What does strict mode change, and when is code strict automatically?
- What's the difference between a polyfill and a transpiler?
- What is a hashbang comment, and why is it in the grammar?
- What is Annex B, and which legacy behaviours does it keep alive?
02Values and types8 questions
The eight language types, how primitives differ from objects, and how to check what a value is.- What are JavaScript's types?
- Why does
typeof nullreturn"object"? - What's the difference between
nullandundefined? - How can a primitive have methods?
- Is JavaScript pass-by-value or pass-by-reference?
- What are Symbols for?
- How do you reliably check a value's type?
- Why doesn't JavaScript have immutable records and tuples?
03Numbers and BigInt8 questions
How JavaScript numbers work as IEEE 754 doubles, their special values, and when BigInt takes over.- Why is
0.1 + 0.2 !== 0.3? - What are
NaN,-0, andInfinity, and how do you test for them? - What's
Number.MAX_SAFE_INTEGER, and when do you need BigInt? Number()vsparseInt()vs unary+— how do they differ?- How do you sum floating-point numbers accurately?
- How do
toFixed,toPrecisionandtoLocaleStringdiffer, and why does(1.005).toFixed(2)give"1.00"? - What happens to a number when you apply a bitwise operator?
- Why shouldn't you use
Math.randomfor tokens or IDs?
- Why is
04Strings and Unicode7 questions
Strings as UTF-16 code units, what that means for length and iteration, and template literals.- Why is
"😀".length2? - How do you iterate over the characters a user sees?
- What are lone surrogates, and what do
isWellFormedandtoWellFormedfix? - How do tagged template literals work?
- How do you compare strings correctly across languages?
slicevssubstringvsat: which string methods accept negative indices, and why?- Is building a string with
+=in a loop slow?
- Why is
05Coercion and equality6 questions
How values convert between types, the algorithms behind==and===, and which comparison each API uses.- How does
==decide whether two values are equal? - Which values are falsy?
- How does an object convert to a primitive?
- Why does
[] + {}give"[object Object]"? ===vsObject.isvs SameValueZero — which comparison does each API use?- How does
<compare values of different types, and why isnull >= 0true?
- How does
06Operators and syntax7 questions
Everyday syntax interviewers probe: destructuring, spread and rest, short-circuiting operators, loops, and semicolons.- How does destructuring work, and where does it throw?
- What's the difference between spread and rest?
??vs||, and how do optional chaining and logical assignment short-circuit?for…invsfor…ofvsforEach— when do you use each?- How does automatic semicolon insertion work, and when does it bite?
- Which precedence and associativity rules trip people up?
- What do the comma operator,
void, labels andswitchfall-through do?
07Scope, hoisting, and execution contexts10 questions
How bindings are created and found: scope, hoisting, the TDZ, and the spec machinery underneath — execution contexts, Environment Records, and realms.- What's the difference between
var,let, andconst? - What is hoisting, really?
- What is the temporal dead zone?
- What is lexical scope, and how does the scope chain work?
- What is an execution context, and what does the call stack hold?
- What is an Environment Record?
- What is the global object, and how does
globalThisrelate to global variables? - What causes "Maximum call stack size exceeded", and do tail calls help?
- What is a realm, and why does
instanceof Arrayfail across iframes? - How do
withand directevalchange scope at run time?
- What's the difference between
08Functions9 questions
The function forms and how they differ, parameters, and the functional techniques interviews ask you to implement.- Function declarations vs expressions vs arrow functions — what actually differs?
- How do default and rest parameters work?
- What is the
argumentsobject, and why avoid it? - What are higher-order functions?
- What is an IIFE, and do you still need one?
- What are currying and partial application?
- Implement
composeandpipe. - Where do a function's
nameandlengthcome from? - What makes a function pure, and why does it matter?
09Closures6 questions
What a closure is in terms of environments, what it keeps alive, and the patterns built on it.- What is a closure?
- Why does a
for (var i…)loop withsetTimeoutprint the same number? - What does a closure keep alive in memory?
- How do closures create private state?
- Implement
debounce,throttle, andonce. - Implement
memoize. What makes the cache key hard?
10
this5 questionsHowthisis bound at each call site, why arrows differ, and how to control it.- How is the value of
thisdetermined? - Why don't arrow functions have their own
this? callvsapplyvsbind?- Why does a method lose
thiswhen passed as a callback? - Implement
Function.prototype.bind.
- How is the value of
11Objects and properties9 questions
The property model — keys, attributes, accessors, integrity levels — and copying and comparing objects.- What can be a property key, and in what order are keys listed?
- What are property descriptors?
Object.freezevssealvspreventExtensions?- How do getters and setters work?
- How do you list an object's properties?
- Shallow vs deep copy — spread,
Object.assign, orstructuredClone? - How do you compare two objects for equality?
- What do computed keys, shorthand properties and method syntax change beyond brevity?
- How do you map or filter an object's properties?
12Prototypes and inheritance8 questions
The[[Prototype]]chain, how lookup and assignment walk it, and whatnewandinstanceofdo.- How does prototypal inheritance work?
__proto__vsprototypevsObject.getPrototypeOf?- What does the
newoperator do? - How does
instanceofwork? - When do you use
Object.create(null)? - Should you extend native prototypes?
- What is prototype pollution, and how do you prevent it?
- What is delegation-style object linking, and how does it compare with constructors and classes?
13Classes7 questions
Whatclassadds over constructor functions: fields, private names, static blocks,super, and subclassing built-ins.- Are classes just syntactic sugar over prototypes?
- How do private fields (
#x) work? - Class fields vs methods — where does each live?
- What are static members and static initialization blocks?
- How does
superwork? - How do you extend built-ins like
ArrayandError? - Composition vs inheritance — when do mixins make sense?
14Arrays8 questions
Array semantics and methods — mutating vs copying, sorting, holes, searching — and the polyfills interviewers ask for.- Which array methods mutate, and what are their copying versions?
- How does
Array.prototype.sortwork? - Implement
map,filter, andreduce. - What are sparse arrays and holes?
- Array-likes vs iterables: how do
Array.fromandArray.fromAsyncwork? includesvsindexOfvsfindvsfindLastvsat?- How do
flatandflatMapwork? - Why does
[].every(fn)returntrue, and what doesfilldo with an object?
15Keyed collections6 questions
Map,Set, and their weak variants, plus grouping and upsert helpers.- When do you use a
Mapinstead of an object? - What can a
Setdo in ES2025? - What are
WeakMapandWeakSetfor, and why can't you iterate them? - How do
Object.groupByandMap.groupBywork? - What does
Map.prototype.getOrInsertsolve? - Implement an LRU cache with
Map.
- When do you use a
16Iterators and generators5 questions
The iteration protocols, generators as pausable functions, lazy iterator helpers, and async iteration.- What are the iteration protocols?
- How do generators pause and resume?
- What are iterator helpers, and why are they lazy?
- What's new for iterators after ES2025?
- How do async iterators and
for await…ofwork?
17Promises8 questions
Promise states and resolution, chaining, combinators, error propagation, and implementing promises yourself.- What is a Promise?
- How does promise chaining work?
Promise.allvsallSettledvsracevsany?- How do errors propagate through promises, and what is an unhandled rejection?
- What do
Promise.withResolversandPromise.trysolve? - Implement
Promise.all. - Implement a Promise from scratch.
- How do you convert a callback API to promises?
18Async functions and the event loop7 questions
How JavaScript schedules work — jobs, tasks, and microtasks — howasync/awaitmaps onto promises, and how to run and cancel async work well.- How does the event loop work?
- Predict the order:
setTimeoutvs promises vsqueueMicrotask. - How does
async/awaitwork under the hood? - Sequential vs parallel
await— andawaitinside loops? - Is JavaScript single-threaded?
- How do you cancel async work?
- Implement a concurrency-limited task runner with retry.
19Errors and cleanup5 questions
Throwing, catching, and custom errors; why async errors escapetry; and deterministic cleanup withusing.- How do
try,catch, andfinallyinteract withreturn? - How do you create custom errors?
- Why doesn't
try/catchcatch errors in a callback? - What do
usingandawait usingdo? - How do you handle errors you didn't catch?
- How do
20Modules9 questions
How ES modules load and link, how they differ from CommonJS, and the newer module features.- How do ES modules load?
- ES modules vs CommonJS — what differs and how do they interoperate?
- What happens with circular imports?
- How does dynamic
import()work? - What does top-level
awaitdo to the module graph? - What are import attributes and JSON modules?
- What is
import.meta? - How does tree shaking work, and what stops it?
- How do browsers resolve bare specifiers with import maps?
21Metaprogramming5 questions
Intercepting and customizing language behaviour: Proxy, Reflect, well-known symbols, exotic objects, andeval.- What can a Proxy intercept, and what are its invariants?
- What is
Reflectfor? - Which well-known symbols let you customize built-in behavior?
- What is an exotic object?
- Why is
evaldangerous, and what's the difference between direct and indirect eval?
22Regular expressions4 questions
Regex flags, groups and lookarounds, performance traps, and the APIs that use patterns.- What do the regex flags do?
- How do named groups and lookbehind work?
- What is catastrophic backtracking?
matchvsmatchAllvsexecvsreplace— andRegExp.escape?
23Dates, Temporal, and Intl4 questions
WhyDateis error-prone, how Temporal replaces it, and locale-aware formatting withIntl.- Why is
Datehard to use correctly? - What is Temporal, and which type do you use when?
- How do you format dates, numbers, and plurals per locale with
Intl? - How do you handle time zones correctly?
- Why is
24JSON and binary data6 questions
JSON serialization edge cases, and raw memory:ArrayBuffer, typed arrays, and shared memory.- What does
JSON.stringifydrop or change? - How do
JSON.parserevivers work, and what does source text access add? - What are
ArrayBuffer, typed arrays, andDataView? - What's new in binary data?
- What are
SharedArrayBufferandAtomicsfor? - What does JavaScript's memory model guarantee when threads race on shared memory?
- What does
25Memory and garbage collection4 questions
Reachability-based garbage collection, how leaks happen and how to find them, and how V8's collector works.- How does garbage collection work in JavaScript?
- What causes memory leaks, and how do you find them?
- What are
WeakRefandFinalizationRegistry, and why use them rarely? - How does V8's generational GC work?
26Inside the engine7 questions
How V8 turns source into fast machine code — tiers, hidden classes, inline caches — and what makes it slow down.- What happens between source code and execution in V8?
- What are hidden classes and inline caches?
- What causes deoptimization?
- How does V8 store arrays?
- How does V8 represent numbers?
- How do code caching and startup snapshots make JavaScript start faster?
- How do SpiderMonkey's and JavaScriptCore's tiers compare with V8's?
27Functional programming3 questions
Functional techniques beyond composition: updating data without mutating it, structures that make that cheap, and the functional vocabulary behindmap,flatMapandthen. Pure functions, currying and composition live in 08 — Functions.- How do you update nested data immutably, and what does each copy cost?
- What are persistent data structures, and how does structural sharing make them cheap?
- Is a Promise a monad?
map,flatMapandthenin functional terms
28Design patterns4 questions
The classic patterns as JavaScript actually expresses them: closures and modules instead of access modifiers, functions instead of factory classes, and events instead of hand-rolled callbacks.- What is the module pattern, and what did ES modules take over from it?
- Implement an event emitter. How does observer differ from publish/subscribe?
- How do you make a singleton in JavaScript, and when is one a mistake?
- Factory functions vs classes: when do you pick which?