JavaScript and TypeScript
279 practice items · needed by 10 roles
Easy 109Medium 97Hard 73
Coding problems
Practice questions
- Block scope of leteasy
- Loose vs strict equalityeasy
- Sync code runs before promise callbackseasy
- typeof null and arrayseasy
- Changing a property of a const objecteasy
- Numbers saved in localStorageeasy
- What fetch does on a 404easy
- TypeScript types at runtimeeasy
- Optional chaining on missing dataeasy
- ?? versus || with zeroeasy
- Order of click handlerseasy
- Sorting numbers without a comparatoreasy
- Why 0.1 + 0.2 is not 0.3easy
- Checking for NaNeasy
- Plus and minus with a stringeasy
- Is an empty array truthyeasy
- When a default parameter applieseasy
- Swapping with destructuringeasy
- Rename and default in destructuringeasy
- Rest parameters versus argumentseasy
- Array.from with a lengtheasy
- Typo in a variable nameeasy
- What JSON.stringify leaves outeasy
- replace changes only one matcheasy
- Changing one letter of a stringeasy
- typeof of a functioneasy
- What && and || returneasy
- Resolving a promise twiceeasy
- What .then returnseasy
- Results of Promise.allSettledeasy
- race versus anyeasy
- Awaiting a non-promiseeasy
- Stopping a polling timereasy
- Default and named importseasy
- Parsing a broken JSON stringeasy
- Cancelling a fetcheasy
- A long loop on the main threadeasy
- Hiding a spinner with finallyeasy
- A rejection nobody handleseasy
- Forgetting to await response.jsoneasy
- Where to run a heavy calculationeasy
- Behaviour of script type moduleeasy
- Type inferred from a leteasy
- Narrowing a union with typeofeasy
- Declaring the same interface twiceeasy
- Type of an optional parametereasy
- Pushing to a readonly arrayeasy
- Type of a const stringeasy
- What as const does to an arrayeasy
- A tuple typeeasy
- Result type of findeasy
- A function that returns nothingeasy
- Limiting a prop to fixed valueseasy
- setTimeout vs microtasksmedium
- Closures in a var loopmedium
- Stale value in useEffectmedium
- Debounce vs throttle for searchmedium
- Arrow function as an object methodmedium
- One failed request breaks the dashboardmedium
- What an async function returnsmedium
- Function hoisting and letmedium
- Spread copies only one levelmedium
- unknown versus anymedium
- reduce on an empty arraymedium
- typeof before a let declarationmedium
- Reading a var before it is setmedium
- Two counters from one factorymedium
- Keeping a balance privatemedium
- this in a plain function callmedium
- Calling bind twicemedium
- Property found on the prototypemedium
- Arrow field versus class methodmedium
- null compared looselymedium
- Adding two arraysmedium
- Freezing a nested configmedium
- What structuredClone cannot copymedium
- Objects as keys in a plain objectmedium
- Attaching data to DOM nodesmedium
- map over new Array(3)medium
- slice versus splicemedium
- for...in over an arraymedium
- Number versus parseInt on "12px"medium
- includes versus indexOf with NaNmedium
- Return value with finallymedium
- When the executor runsmedium
- A chain after catchmedium
- Order of Promise.all resultsmedium
- Reading pages with for awaitmedium
- Error inside a setTimeout callbackmedium
- Total wait with exponential backoffmedium
- Timing a JavaScript animationmedium
- Loading a chart library on clickmedium
- An imported let that changesmedium
- __dirname in an ES modulemedium
- nextTick versus promise in Nodemedium
- Wrapping an error with a causemedium
- Adding a timeout to fetchmedium
- Listener that will not go awaymedium
- Passive touch listenersmedium
- Handler that should run oncemedium
- When Promise.any rejectsmedium
- An endless chain of microtasksmedium
- Resolving with two valuesmedium
- What Promise.withResolvers givesmedium
- Inferring a generic typemedium
- Constraining a genericmedium
- A typed getter with keyofmedium
- Type for a PATCH bodymedium
- A tax-rate lookup tablemedium
- Narrowing on a kind fieldmedium
- A function that narrows a typemedium
- Narrowing with the in operatormedium
- The ! after a valuemedium
- satisfies versus a type annotationmedium
- Reusing a function’s return typemedium
- Passing an object with extra fieldsmedium
- Indexing with noUncheckedIndexedAccessmedium
- Unwrapping a promise typemedium
- Changing an object in statemedium
- Adding to a list in statemedium
- Removing a row from statemedium
- Race condition in data fetchinghard
- Losing this when a method is extractedhard
- Order of logs around awaithard
- Order of object keyshard
- map with parseInthard
- Exhaustive check with neverhard
- When extra properties are an errorhard
- Comparator that returns a booleanhard
- Closure holding a big arrayhard
- Spreading an object with a getterhard
- Symbol keys and JSONhard
- Object.is and negative zerohard
- Deep merge of user JSONhard
- Sorting orders that tiehard
- Using new on an arrow functionhard
- Checking for a private fieldhard
- Passing values into a generatorhard
- Making an object spreadablehard
- Arguments to a tagged templatehard
- Proxy set trap that returns nothinghard
- arguments inside an arrow functionhard
- Adding a BigInt and a numberhard
- Class getter and hasOwnPropertyhard
- return versus return await in tryhard
- A promise awaited too latehard
- Breaking out of for awaithard
- Progress bar that never moveshard
- Sending a callback to a workerhard
- ArrayBuffer after transferhard
- Relying on FinalizationRegistryhard
- setImmediate inside an I/O callbackhard
- A debounce that never debounceshard
- Time with a concurrency limithard
- Throwing after resolvehard
- Top-level await in a config modulehard
- Promise.resolve of a promisehard
- Breaking up a long taskhard
- try/catch around forEach with asynchard
- A conditional type over a unionhard
- Extracting a type with inferhard
- Removing optional and readonlyhard
- Building handler names from keyshard
- Method versus property function typeshard
- Stopping mixed-up string IDshard
- A const type parameterhard
- Type of the catch variablehard
- Typing a global on windowhard
- What the {} type acceptshard
- Old value after an awaithard
- useEffect(async () => ...)hard
- A custom hook with a stale callbackhard
- Promise and setTimeout ordereasy
- fetch treats a 404 as successeasy
- slice vs spliceeasy
- indexOf and NaNeasy
- new Array(3) then mapeasy
- Value missing from indexOfeasy
- parseInt on a CSS valueeasy
- Number of an empty form fieldeasy
- Checking whether a value is an arrayeasy
- Comparing an array with its copyeasy
- Using shift as a queueeasy
- join with null valueseasy
- Flattening a nested arrayeasy
- Removing duplicates with a Seteasy
- Number keys in a plain objecteasy
- Iteration order of a Mapeasy
- When to choose Map over a plain objecteasy
- Set of look-alike objectseasy
- Reading a key that is not in a Mapeasy
- Checking a key by its valueeasy
- Counting entries in a Mapeasy
- Adding a value that is already in a Seteasy
- Building a Map from pairseasy
- Looping over a Mapeasy
- Adding stock to an inventory mapeasy
- What Map.delete returnseasy
- The in operator on a plain objecteasy
- Argument order in Map.forEacheasy
- Turning a Map into an object for JSONeasy
- String and number keys in a Mapeasy
- Set size after a deleteeasy
- Type of keys from Object.keyseasy
- Emptying a Mapeasy
- Unique letters in a wordeasy
- Checking for NaNeasy
- Dividing by zero in JavaScripteasy
- parseInt with a radixeasy
- JavaScript default sort on numberseasy
- Comparator sign for ascending ordereasy
- Using a JavaScript array as a stackeasy
- Cost of Array.shift in a queueeasy
- Copying an array of order objectsmedium
- Building a grid with fillmedium
- Comparing numeric stringsmedium
- forEach on an array with holesmedium
- Overflow in an Int32Arraymedium
- Reading the last elementmedium
- Grid coordinates as a JavaScript keymedium
- Caching data per object without leaksmedium
- Ranking products by salesmedium
- Checking that two Sets are equalmedium
- Built-in Set operations in JavaScriptmedium
- 2**31 | 0 in JavaScriptmedium
- What -1 >>> 0 givesmedium
- Math.round(-2.5) in JavaScriptmedium
- Is JavaScript Array sort stable?medium
- Comparator that returns a booleanmedium
- Sorting customer names correctlymedium
- Promise callback versus setTimeout ordermedium
- Removing items while looping forwardhard
- Counting DP mod 1e9+7 in JavaScripthard
- Deleting entries while loopinghard
- Word counts that break on "constructor"hard
- NaN and -0 as Map keyshard
- Key order in a plain objecthard
- Adding to a Map during forEachhard
- What Object.groupBy returnshard
- Memo cache misses for equal argumentshard
- Adding 1 to 2^53hard
- Default sort of a Float64Arrayhard
- Binary search loop that never endshard
- Bit-shift midpoint in JavaScripthard
- Do circular links leak memory in JavaScript?hard
- Promise loop that freezes timershard
- fetch and error status codeseasy
- Timer vs promise ordereasy
- Optional property in strict modeeasy
- try/catch around an async calleasy
- map with an async callbackeasy
- Dates sent through JSONeasy
- One failing widget breaks the dashboardmedium
- Three awaits, three times slowermedium
- One schema for form and APImedium
- Type cast on fetch responsemedium
- One report slows every requestmedium
- Birthday shows one day earlyhard
- Large IDs change in the browserhard
- TypeScript in new React Native appseasy
- When @escaping is neededmedium
- Closure capture listhard
- Sending ETH to a plain addresseasy
- Default value of an enumeasy
- Comparing two stringseasy
- Length of a rupee stringmedium
- One failure in Promise.allhard
- A missing awaiteasy
- toBe versus toEqualeasy
- Cypress values are not returnedmedium
- Hidden race in a testhard
- Missing the response you wait forhard
- Protecting a fixed go-livemedium
- Why state what is out of scopeeasy
- What scope creep iseasy
- What a context diagram showseasy
- Agreeing where a process startsmedium
- The team adds an extra featurehard