03 · Core
JavaScript
The language, deeply — the questions asked in every frontend loop.
The language, deeply. These are the questions that get asked in every frontend loop — and where machine-coding rounds start.
⭐ Flagship: Promise polyfills + debounce/throttle deep-dive · Output-based questions with answers
Core language
| Topic | Difficulty | Time | Tags | Best Resources |
|---|---|---|---|---|
var / let / const, scope, hoisting, TDZ |
🟢 | 45m | #basics |
javascript.info: variables ⭐ |
Data types & coercion (== vs ===) |
🟢 | 45m | #basics |
javascript.info: type conversions ⭐ |
| Closures | 🟡 | 1h | #closures |
javascript.info: closures ⭐ |
this binding (4 rules) |
🟡 | 45m | #this |
javascript.info: this ⭐ |
call / apply / bind (+ polyfills) |
🟡 | 45m | #this #polyfill |
MDN: bind ⭐ |
| Prototypes & prototype chain | 🟡 | 1h | #prototype #oop |
javascript.info: prototypes ⭐ |
| Classes & inheritance | 🟡 | 45m | #oop |
javascript.info: classes ⭐ |
| Objects, descriptors, getters/setters | 🟡 | 45m | #objects |
javascript.info: property flags ⭐ |
| Destructuring, spread, rest | 🟢 | 30m | #basics |
javascript.info: destructuring ⭐ |
| Optional chaining & nullish coalescing | 🟢 | 20m | #basics |
MDN: optional chaining ⭐ |
Symbol & well-known symbols |
🟡 | 30m | #advanced |
javascript.info: symbols ⭐ |
Map / Set vs objects/arrays |
🟢 | 30m | #basics |
javascript.info: Map/Set ⭐ |
Async
| Topic | Difficulty | Time | Tags | Best Resources |
|---|---|---|---|---|
| Event loop, micro/macrotasks | 🟡 | 1h | #async #internals |
Jake Archibald: in the loop ⭐ |
| Callbacks & callback hell | 🟢 | 30m | #async |
javascript.info: callbacks ⭐ |
| Promises (states, chaining) | 🟡 | 1h | #async #promises |
javascript.info: promises ⭐ |
Promise.all/allSettled/race/any |
🟡 | 45m | #async #polyfill |
Flagship ⭐ |
| async / await + error handling | 🟡 | 45m | #async |
javascript.info: async/await ⭐ |
| Debounce & throttle | 🟡 | 45m | #patterns #performance |
Flagship ⭐ |
| AbortController & cancellation | 🟡 | 30m | #async |
MDN: AbortController ⭐ |
Async iterators & for await |
🔴 | 45m | #async #iterators |
javascript.info: async iteration ⭐ |
| Concurrency control (promise pool) | 🔴 | 45m | #async #patterns |
BFE.dev ⭐ |
Functions & FP
| Topic | Difficulty | Time | Tags | Best Resources |
|---|---|---|---|---|
| Higher-order functions | 🟢 | 30m | #functional |
javascript.info ⭐ |
| Currying & partial application | 🟡 | 45m | #functional |
javascript.info: currying ⭐ |
Composition (pipe/compose) |
🟡 | 30m | #functional |
BFE.dev ⭐ |
| Pure functions & immutability | 🟡 | 45m | #functional #state |
Immer docs ⭐ |
| Memoization | 🟡 | 30m | #functional #performance |
BFE.dev ⭐ |
| Generators | 🔴 | 1h | #generators |
javascript.info: generators ⭐ |
| Iterators & iterables | 🟡 | 45m | #iterators |
javascript.info: iterables ⭐ |
Modules, workers & advanced
| Topic | Difficulty | Time | Tags | Best Resources |
|---|---|---|---|---|
| Modules (ESM vs CJS) | 🟡 | 45m | #modules |
javascript.info: modules ⭐ |
| Web Workers | 🟡 | 1h | #workers #performance |
MDN: web workers ⭐ |
| Service Workers | 🔴 | 1.5h | #workers #offline |
MDN: service workers ⭐ |
| Shared Workers | 🔴 | 45m | #workers |
MDN: SharedWorker ⭐ |
| Streams API | 🔴 | 1h | #streams |
MDN: streams ⭐ |
| Proxy & Reflect | 🔴 | 1h | #metaprogramming |
javascript.info: Proxy ⭐ |
| WeakMap & WeakSet | 🟡 | 45m | #memory |
javascript.info: WeakMap ⭐ |
| WeakRef & FinalizationRegistry | 🔴 | 45m | #memory #advanced |
MDN: WeakRef ⭐ |
| Memory leaks in JS | 🔴 | 1h | #memory |
web.dev: memory ⭐ |
| Regular expressions | 🟡 | 1h | #regex |
javascript.info: regexp ⭐ |
structuredClone & deep clone |
🟡 | 30m | #patterns |
MDN: structuredClone ⭐ |
| Polyfills (map/filter/reduce/bind/Promise) | 🔴 | 2h | #polyfill |
Flagship ⭐ |
Numbers, BigInt, floating point |
🟡 | 30m | #basics |
javascript.info: numbers ⭐ |
| Date & time handling | 🟢 | 30m | #basics |
MDN: Date ⭐ |
❓ Rapid-fire JavaScript interview questions
The exact questions asked in real JavaScript interviews. Answer out loud, then verify against the resources above.
- What is a closure? Give a real-world use case.
- Explain the event loop — how do microtasks and macrotasks differ?
- What's the difference between
==and===? - What is hoisting? How do
var,let, andconstdiffer? - How does
thiswork? What docall,apply, andbinddo? - What is the prototype chain and prototypal inheritance?
- Difference between
nullandundefined? - What is event delegation and why is it useful?
- How do you deep clone an object? Shallow vs deep copy?
- What are
debounceandthrottle— and when do you use each? - Explain
Promise.allvsallSettledvsracevsany. - What is
async/awaitand how do you handle errors in it? - What is the temporal dead zone (TDZ)?
- How do ES Modules differ from CommonJS?
- What is currying and partial application?
mapvsforEachvsreduce— when to use which?- What is a generator function?
- What causes memory leaks in JavaScript?
- What are
WeakMap/WeakSetand when are they useful? - What is a Proxy and what can it do?
- What's the difference between synchronous and asynchronous code?
- How does garbage collection work in JS engines?
- What is a pure function and why does immutability matter?
- What do optional chaining (
?.) and nullish coalescing (??) do? - How do you cancel a fetch request (AbortController)?
slicevssplice? What doesObject.freezedo?setTimeoutvssetIntervalvsrequestAnimationFrame?- What is the difference between call by value and call by reference?
- How does
Array.prototype.reducework — implement it. - What is the output? (event-loop / closure / hoisting trick questions)
🧩 Output-based & "predict the output" questions
The trick questions that separate people who know JS from people who use JS.
📖 Want the answers + explanations? See the full worked set → output-based-questions.md
- What logs?
console.log(1); setTimeout(()=>console.log(2)); Promise.resolve().then(()=>console.log(3)); console.log(4); for (var i=0;i<3;i++) setTimeout(()=>console.log(i))— output? Fix withlet.- What does
[1,2,3].map(parseInt)return and why? - Why is
0.1 + 0.2 === 0.3false? - What is
typeof null,typeof NaN,typeof function(){}? [] == ![]— true or false? Walk through the coercion.- Arrow vs regular function: what is
thisin each here? - Predict the output with hoisting (function vs
vardeclarations). console.log("b" + "a" + +"a" + "a")— what prints?- What's the order of
async/await+.then+setTimeoutlogs? {} + []vs[] + {}— explain.- Does modifying a copied object mutate the original? (reference vs value)
💻 "Implement this" coding challenges
Classic implement-from-scratch prompts — see the flagship and machine-coding utilities.
- Implement
debounceandthrottle. - Implement
Promise.all,allSettled,race,any. - Implement
Array.prototype.map/filter/reduce. - Implement
Function.prototype.bind. - Implement
deepClone(handle cycles). - Implement
curry,pipe,compose. - Implement
memoize. - Implement an EventEmitter (
on/off/emit/once). - Implement
flattenfor a nested array. - Implement
retrywith exponential backoff. - Implement
once(call a function at most once). - Implement a promise-based
sleep(ms). - Implement
groupBy/chunk/uniqBy. - Implement an LRU cache.
- Implement a promise concurrency limiter (pool).
Related: 02-browser · 04-typescript · 18-design-patterns · 16-machine-coding
Missing something? Add a row.