Topics

Jump to a topic.

Search questions

Find a question by title, tag, or summary.

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.
26
chapters
150
questions
44
core
  • Covers ECMAScript through ES2026, plus Stage 4 proposals shipping in ES2027; V8 as the reference engine.
  1. 01How JavaScript runs6 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?Coming soon
    • How does a feature become part of JavaScript?Coming soon
    • Is JavaScript compiled or interpreted?Coming soon
    • What's the difference between a script and a module?Coming soon
    • What does strict mode change, and when is code strict automatically?Coming soon
    • What's the difference between a polyfill and a transpiler?Coming soon
    Open chapter page
  2. 02Values and types7 questions
    The eight language types, how primitives differ from objects, and how to check what a value is.
    • What are JavaScript's types?Coming soon
    • Why does typeof null return "object"?Coming soon
    • What's the difference between null and undefined?Coming soon
    • How can a primitive have methods?Coming soon
    • Is JavaScript pass-by-value or pass-by-reference?Coming soon
    • What are Symbols for?Coming soon
    • How do you reliably check a value's type?Coming soon
    Open chapter page
  3. 03Numbers and BigInt5 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?Coming soon
    • What are NaN, -0, and Infinity, and how do you test for them?Coming soon
    • What's Number.MAX_SAFE_INTEGER, and when do you need BigInt?Coming soon
    • Number() vs parseInt() vs unary + — how do they differ?Coming soon
    • How do you sum floating-point numbers accurately?Coming soon
    Open chapter page
  4. 04Strings and Unicode5 questions
    Strings as UTF-16 code units, what that means for length and iteration, and template literals.
    • Why is "😀".length 2?Coming soon
    • How do you iterate over the characters a user sees?Coming soon
    • What are lone surrogates, and what do isWellFormed and toWellFormed fix?Coming soon
    • How do tagged template literals work?Coming soon
    • How do you compare strings correctly across languages?Coming soon
    Open chapter page
  5. 05Coercion and equality5 questions
    How values convert between types, the algorithms behind == and ===, and which comparison each API uses.
    • How does == decide whether two values are equal?Coming soon
    • Which values are falsy?Coming soon
    • How does an object convert to a primitive?Coming soon
    • Why does [] + {} give "[object Object]"?Coming soon
    • === vs Object.is vs SameValueZero — which comparison does each API use?Coming soon
    Open chapter page
  6. 06Operators and syntax5 questions
    Everyday syntax interviewers probe: destructuring, spread and rest, short-circuiting operators, loops, and semicolons.
    • How does destructuring work, and where does it throw?Coming soon
    • What's the difference between spread and rest?Coming soon
    • ?? vs ||, and how do optional chaining and logical assignment short-circuit?Coming soon
    • for…in vs for…of vs forEach — when do you use each?Coming soon
    • How does automatic semicolon insertion work, and when does it bite?Coming soon
    Open chapter page
  7. 07Scope, hoisting, and execution contexts9 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, and const?Coming soon
    • What is hoisting, really?Coming soon
    • What is the temporal dead zone?Coming soon
    • What is lexical scope, and how does the scope chain work?Coming soon
    • What is an execution context, and what does the call stack hold?Coming soon
    • What is an Environment Record?Coming soon
    • What is the global object, and how does globalThis relate to global variables?Coming soon
    • What causes "Maximum call stack size exceeded", and do tail calls help?Coming soon
    • What is a realm, and why does instanceof Array fail across iframes?Coming soon
    Open chapter page
  8. 08Functions7 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?Coming soon
    • How do default and rest parameters work?Coming soon
    • What is the arguments object, and why avoid it?Coming soon
    • What are higher-order functions?Coming soon
    • What is an IIFE, and do you still need one?Coming soon
    • What are currying and partial application?Coming soon
    • Implement compose and pipe.Coming soon
    Open chapter page
  9. 09Closures5 questions
    What a closure is in terms of environments, what it keeps alive, and the patterns built on it.
    • What is a closure?Coming soon
    • Why does a for (var i…) loop with setTimeout print the same number?Coming soon
    • What does a closure keep alive in memory?Coming soon
    • How do closures create private state?Coming soon
    • Implement debounce, throttle, and once.Coming soon
    Open chapter page
  10. 10`this`5 questions
    How this is bound at each call site, why arrows differ, and how to control it.
    • How is the value of this determined?Coming soon
    • Why don't arrow functions have their own this?Coming soon
    • call vs apply vs bind?Coming soon
    • Why does a method lose this when passed as a callback?Coming soon
    • Implement Function.prototype.bind.Coming soon
    Open chapter page
  11. 11Objects and properties7 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?Coming soon
    • What are property descriptors?Coming soon
    • Object.freeze vs seal vs preventExtensions?Coming soon
    • How do getters and setters work?Coming soon
    • How do you list an object's properties?Coming soon
    • Shallow vs deep copy — spread, Object.assign, or structuredClone?Coming soon
    • How do you compare two objects for equality?Coming soon
    Open chapter page
  12. 12Prototypes and inheritance6 questions
    The [[Prototype]] chain, how lookup and assignment walk it, and what new and instanceof do.
    • How does prototypal inheritance work?Coming soon
    • __proto__ vs prototype vs Object.getPrototypeOf?Coming soon
    • What does the new operator do?Coming soon
    • How does instanceof work?Coming soon
    • When do you use Object.create(null)?Coming soon
    • Should you extend native prototypes?Coming soon
    Open chapter page
  13. 13Classes7 questions
    What class adds over constructor functions: fields, private names, static blocks, super, and subclassing built-ins.
    • Are classes just syntactic sugar over prototypes?Coming soon
    • How do private fields (#x) work?Coming soon
    • Class fields vs methods — where does each live?Coming soon
    • What are static members and static initialization blocks?Coming soon
    • How does super work?Coming soon
    • How do you extend built-ins like Array and Error?Coming soon
    • Composition vs inheritance — when do mixins make sense?Coming soon
    Open chapter page
  14. 14Arrays7 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?Coming soon
    • How does Array.prototype.sort work?Coming soon
    • Implement map, filter, and reduce.Coming soon
    • What are sparse arrays and holes?Coming soon
    • Array-likes vs iterables: how do Array.from and Array.fromAsync work?Coming soon
    • includes vs indexOf vs find vs findLast vs at?Coming soon
    • How do flat and flatMap work?Coming soon
    Open chapter page
  15. 15Keyed collections5 questions
    Map, Set, and their weak variants, plus grouping and upsert helpers.
    • When do you use a Map instead of an object?Coming soon
    • What can a Set do in ES2025?Coming soon
    • What are WeakMap and WeakSet for, and why can't you iterate them?Coming soon
    • How do Object.groupBy and Map.groupBy work?Coming soon
    • What does Map.prototype.getOrInsert solve?Coming soon
    Open chapter page
  16. 16Iterators and generators5 questions
    The iteration protocols, generators as pausable functions, lazy iterator helpers, and async iteration.
    • What are the iteration protocols?Coming soon
    • How do generators pause and resume?Coming soon
    • What are iterator helpers, and why are they lazy?Coming soon
    • What's new for iterators after ES2025?Coming soon
    • How do async iterators and for await…of work?Coming soon
    Open chapter page
  17. 17Promises8 questions
    Promise states and resolution, chaining, combinators, error propagation, and implementing promises yourself.
    • What is a Promise?Coming soon
    • How does promise chaining work?Coming soon
    • Promise.all vs allSettled vs race vs any?Coming soon
    • How do errors propagate through promises, and what is an unhandled rejection?Coming soon
    • What do Promise.withResolvers and Promise.try solve?Coming soon
    • Implement Promise.all.Coming soon
    • Implement a Promise from scratch.Coming soon
    • How do you convert a callback API to promises?Coming soon
    Open chapter page
  18. 18Async functions and the event loop7 questions
    How JavaScript schedules work — jobs, tasks, and microtasks — how async/await maps onto promises, and how to run and cancel async work well.
    • How does the event loop work?Coming soon
    • Predict the order: setTimeout vs promises vs queueMicrotask.Coming soon
    • How does async/await work under the hood?Coming soon
    • Sequential vs parallel await — and await inside loops?Coming soon
    • Is JavaScript single-threaded?Coming soon
    • How do you cancel async work?Coming soon
    • Implement a concurrency-limited task runner with retry.Coming soon
    Open chapter page
  19. 19Errors and cleanup5 questions
    Throwing, catching, and custom errors; why async errors escape try; and deterministic cleanup with using.
    • How do try, catch, and finally interact with return?Coming soon
    • How do you create custom errors?Coming soon
    • Why doesn't try/catch catch errors in a callback?Coming soon
    • What do using and await using do?Coming soon
    • How do you handle errors you didn't catch?Coming soon
    Open chapter page
  20. 20Modules7 questions
    How ES modules load and link, how they differ from CommonJS, and the newer module features.
    • How do ES modules load?Coming soon
    • ES modules vs CommonJS — what differs and how do they interoperate?Coming soon
    • What happens with circular imports?Coming soon
    • How does dynamic import() work?Coming soon
    • What does top-level await do to the module graph?Coming soon
    • What are import attributes and JSON modules?Coming soon
    • What is import.meta?Coming soon
    Open chapter page
  21. 21Metaprogramming5 questions
    Intercepting and customizing language behaviour: Proxy, Reflect, well-known symbols, exotic objects, and eval.
    • What can a Proxy intercept, and what are its invariants?Coming soon
    • What is Reflect for?Coming soon
    • Which well-known symbols let you customize built-in behavior?Coming soon
    • What is an exotic object?Coming soon
    • Why is eval dangerous, and what's the difference between direct and indirect eval?Coming soon
    Open chapter page
  22. 22Regular expressions4 questions
    Regex flags, groups and lookarounds, performance traps, and the APIs that use patterns.
    • What do the regex flags do?Coming soon
    • How do named groups and lookbehind work?Coming soon
    • What is catastrophic backtracking?Coming soon
    • match vs matchAll vs exec vs replace — and RegExp.escape?Coming soon
    Open chapter page
  23. 23Dates, Temporal, and Intl4 questions
    Why Date is error-prone, how Temporal replaces it, and locale-aware formatting with Intl.
    • Why is Date hard to use correctly?Coming soon
    • What is Temporal, and which type do you use when?Coming soon
    • How do you format dates, numbers, and plurals per locale with Intl?Coming soon
    • How do you handle time zones correctly?Coming soon
    Open chapter page
  24. 24JSON and binary data5 questions
    JSON serialization edge cases, and raw memory: ArrayBuffer, typed arrays, and shared memory.
    • What does JSON.stringify drop or change?Coming soon
    • How do JSON.parse revivers work, and what does source text access add?Coming soon
    • What are ArrayBuffer, typed arrays, and DataView?Coming soon
    • What's new in binary data?Coming soon
    • What are SharedArrayBuffer and Atomics for?Coming soon
    Open chapter page
  25. 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?Coming soon
    • What causes memory leaks, and how do you find them?Coming soon
    • What are WeakRef and FinalizationRegistry, and why use them rarely?Coming soon
    • How does V8's generational GC work?Coming soon
    Open chapter page
  26. 26Inside the engine5 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?Coming soon
    • What are hidden classes and inline caches?Coming soon
    • What causes deoptimization?Coming soon
    • How does V8 store arrays?Coming soon
    • How does V8 represent numbers?Coming soon
    Open chapter page