Sector file // javascript
JAVASCRIPTDECODED.
Closures, async & the core
Easy
6 questionsHow would you use the Page Visibility API to pause a setInterval-based poller when a user switches to a different browser tab?
Phone Screen ยท 722 views ยท perf-api, tricky, real-world
What is the difference between null and undefined?
Frontend ยท 584 views ยท null, undefined
What is the difference between synchronous and asynchronous code?
Frontend ยท 420 views ยท sync-async
Why would you use performance.now() instead of Date.now() to measure how long a function takes to run?
Phone Screen ยท 364 views ยท perf-api, tricky, real-world
What is destructuring?
Frontend ยท 198 views ยท destructuring
What is JSON and why is it commonly used?
Phone Screen ยท 167 views ยท json, data format, api
Medium
14 questionsDebounce vs throttle โ implement debounce
Frontend ยท Netflix ยท 3.7k views ยท javascript, performance
How would you use the BroadcastChannel API to sync application state across multiple open browser tabs?
Frontend ยท 1.1k views ยท messaging, tricky, real-world
How does the fetch API work?
Frontend ยท 1.1k views ยท fetch
What is the difference between `Object.groupBy()` and `Map.groupBy()` โ keys, prototypes and ordering?
Frontend ยท 677 views ยท es2024, map-groupby, object-groupby
How would you use ResizeObserver to react to an element's size changing, without polling getBoundingClientRect() on every frame?
Frontend ยท 645 views ยท observers, tricky, real-world
How would you use IntersectionObserver to lazy-load images only as they scroll into the viewport?
Frontend ยท 543 views ยท observers, tricky, real-world
What does queueMicrotask() do, and how does its callback ordering compare to a resolved Promise .then() and setTimeout(fn, 0)?
Phone Screen ยท 499 views ยท event-loop, microtask, queuemicrotask
How would you use MutationObserver to detect when a third-party script injects new nodes into the DOM?
Frontend ยท 440 views ยท observers, tricky, real-world
Hard
12 questionsHow does `Atomics.waitAsync()` enable non-blocking waits on SharedArrayBuffer?
DSA ยท 1.1k views ยท atomics, sharedarraybuffer, concurrency
What is the Reflect API?
Frontend ยท 884 views ยท reflect
How would you implement an async generator function to stream paginated API results, and how does a consumer use it with for await...of?
DSA ยท 802 views ยท async-generator, generators, async-iteration
How do you implement a throttle function?
Frontend ยท 660 views ยท throttle
What is ShadowRealm and how does it provide true JavaScript sandboxing?
Frontend ยท 640 views ยท shadowrealm, sandbox, isolation
How does ArrayBuffer transfer and detach work with `transfer()` vs `transferToFixedLength()`?
DSA ยท 608 views ยท arraybuffer, transfer, memory
What are tagged template literals?
Frontend ยท 588 views ยท tagged-templates
How does the Temporal API fix JavaScript Date โ Instant, PlainDate and ZonedDateTime?
Frontend ยท 437 views ยท temporal, es2024, date
Seen a JavaScript question that is not here? Add it and help the next candidate.
Share a question