β‘ Interview Prep
JavaScript
Closures, this, promises, the event loop, and the utility functions front-end and full-stack interviews ask you to build by hand.
100 questions, most asked first
Ranked by how often each question comes up in real interviews. #1 is the most common.
All patternsScope & closuresEvent loopTypes & coercionBuild it yourselfthis & prototypesAsync & promisesArrays & objectsReferences & copyingModern syntax
#1π¬What is a closure?Scope & closuresMediumFree#2π¬Explain the event loopEvent loopMediumFree#3π¬let vs const vs varScope & closuresEasyFree#4π¬== vs ===Types & coercionEasyFree#5β¨οΈImplement debounceBuild it yourselfMediumFree#6π¬How does `this` work?this & prototypesMediumFree#7π¬Promises vs async/awaitAsync & promisesMediumFree#8π¬What is hoisting?Scope & closuresEasyFree#9β¨οΈFizzBuzzArrays & objectsEasyFree#10β¨οΈImplement deepCloneReferences & copyingMediumFreeπUnlock 90 more JavaScript questions Β· all 1,200 questions for $39/year (about 11Β’ a day)See full access#11β¨οΈImplement throttleBuild it yourselfMediumπ#12β¨οΈImplement Promise.allAsync & promisesMediumπ#13β¨οΈmap, filter and reduceArrays & objectsEasyπ#14π¬Prototypal inheritancethis & prototypesMediumπ#15π¬null vs undefinedTypes & coercionEasyπ#16π¬call, apply and bindthis & prototypesMediumπ#17β¨οΈImplement Function.prototype.bindthis & prototypesMediumπ#18π¬Arrow functions vs regular functionsModern syntaxEasyπ#19π¬Shallow copy vs deep copyReferences & copyingEasyπ#20β¨οΈFlatten a nested arrayBuild it yourselfMediumπ#21β¨οΈImplement memoizeBuild it yourselfMediumπ#22β¨οΈImplement curryBuild it yourselfMediumπ#23π¬Spread vs rest (`...`)Modern syntaxEasyπ#24π¬DestructuringModern syntaxEasyπ#25π¬Truthy and falsy valuesTypes & coercionEasyπ#26π¬typeof and checking typesTypes & coercionEasyπ#27π¬Which array methods mutate?Arrays & objectsEasyπ#28β¨οΈImplement Array.prototype.mapBuild it yourselfEasyπ#29β¨οΈImplement Array.prototype.reduceBuild it yourselfMediumπ#30π¬Promise.allSettled, race and anyAsync & promisesMediumπ#31β¨οΈWrite a sleep functionAsync & promisesEasyπ#32β¨οΈRetry with exponential backoffAsync & promisesMediumπ#33β¨οΈImplement an EventEmitterBuild it yourselfMediumπ#34β¨οΈImplement groupByArrays & objectsEasyπ#35β¨οΈChunk an arrayArrays & objectsEasyπ#36β¨οΈRemove duplicates from an arrayArrays & objectsEasyπ#37π¬const vs Object.freezeReferences & copyingEasyπ#38π¬Classes in JavaScriptthis & prototypesEasyπ#39π¬Error handling in async codeAsync & promisesMediumπ#40π¬Microtasks vs macrotasksEvent loopHardπ#41π¬What does "use strict" do?Types & coercionEasyπ#42π¬What is an IIFE?Scope & closuresEasyπ#43π¬Pure functions and side effectsArrays & objectsEasyπ#44β¨οΈHigher-order functionsArrays & objectsEasyπ#45π¬Lexical scope and the scope chainScope & closuresMediumπ#46π¬Garbage collection and memory leaksReferences & copyingMediumπ#47π¬WeakMap and WeakSetReferences & copyingMediumπ#48π¬Map vs plain objectArrays & objectsEasyπ#49β¨οΈSet intersection, union and differenceArrays & objectsEasyπ#50π¬What are Symbols?Types & coercionMediumπ#51π¬Generators and iteratorsModern syntaxMediumπ#52π¬forβ¦in vs forβ¦ofArrays & objectsEasyπ#53π¬Optional chaining (?.) and nullish coalescing (??)Modern syntaxEasyπ#54β¨οΈCapitalize each wordArrays & objectsEasyπ#55π¬Why is 0.1 + 0.2 !== 0.3?Types & coercionEasyπ#56π¬NaNTypes & coercionEasyπ#57π¬Implicit type coercionTypes & coercionMediumπ#58π¬ES modules vs CommonJSModern syntaxMediumπ#59π¬Promise chainingAsync & promisesMediumπ#60β¨οΈImplement a simple PromiseAsync & promisesHardπ#61β¨οΈImplement deepEqualBuild it yourselfMediumπ#62β¨οΈImplement onceBuild it yourselfEasyπ#63β¨οΈImplement pipe and composeBuild it yourselfEasyπ#64β¨οΈLRU Cache with a MapBuild it yourselfMediumπ#65β¨οΈParse a query stringBuild it yourselfEasyπ#66β¨οΈSafely get a nested value (lodash.get)Build it yourselfEasyπ#67π¬setTimeout vs setIntervalEvent loopEasyπ#68β¨οΈImplement promisifyAsync & promisesMediumπ#69β¨οΈRun async tasks with a concurrency limitAsync & promisesHardπ#70π¬The Node.js event loop and non-blocking I/OEvent loopMediumπ#71π¬Web Workers and the main threadEvent loopMediumπ#72π¬The call stack and stack overflowEvent loopEasyπ#73π¬The temporal dead zoneScope & closuresMediumπ#74π¬Function declarations vs expressionsScope & closuresEasyπ#75π¬JSON.stringify gotchasReferences & copyingMediumπ#76π¬Why does [10, 1, 2].sort() look wrong?Arrays & objectsEasyπ#77π¬Array length and holesArrays & objectsMediumπ#78π¬instanceof vs typeofthis & prototypesEasyπ#79π¬extends, super and method overridingthis & prototypesMediumπ#80β¨οΈCustom error classesthis & prototypesMediumπ#81π¬Debounce vs throttle, when to use whichBuild it yourselfEasyπ#82β¨οΈImmutable updates of nested stateReferences & copyingMediumπ#83π¬Composition over inheritancethis & prototypesMediumπ#84β¨οΈValidate input with a regular expressionArrays & objectsMediumπ#85π¬JavaScript Date pitfallsTypes & coercionMediumπ#86π¬Why use TypeScript?Modern syntaxEasyπ#87π¬TypeScript interface vs typeModern syntaxMediumπ#88π¬TypeScript genericsModern syntaxMediumπ#89π¬any vs unknown vs neverTypes & coercionMediumπ#90π¬Bundlers, tree shaking and code splittingModern syntaxMediumπ#91β¨οΈAdd a timeout to any promiseAsync & promisesMediumπ#92β¨οΈDeduplicate in-flight requestsAsync & promisesMediumπ#93β¨οΈImplement deepFreezeReferences & copyingEasyπ#94β¨οΈImplement instanceofthis & prototypesMediumπ#95β¨οΈMost frequent characterArrays & objectsEasyπ#96β¨οΈReverse a string and check palindromesArrays & objectsEasyπ#97π¬Object.keys, values, entries and fromEntriesArrays & objectsEasyπ#98β¨οΈSort objects by multiple keysArrays & objectsMediumπ#99π¬Polyfills vs transpilingModern syntaxEasyπ#100π¬Making JavaScript fasterEvent loopMediumπ