Sector file // javascript

JAVASCRIPTDECODED.

Closures, async & the core

165 Questions103.9k Views7.0k Upvotes
41 easy77 med47 hard

Easy

8 questions

How would you use Object.groupBy() to group an array of orders by status, and how does it compare to a manual reduce()?

Frontend ยท 1.2k views

How does Array.prototype.with() let you replace one array element immutably, and where would that pattern actually help?

Phone Screen ยท 1.1k views

How does 'use strict' change what `this` refers to inside a regular function called without a receiver, compared to non-strict mode?

Phone Screen ยท 1.1k views

How does Array.prototype.toSorted() differ from .sort(), and why does that matter when updating state immutably?

Phone Screen ยท 1.1k views

How 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

Why would you use performance.now() instead of Date.now() to measure how long a function takes to run?

Phone Screen ยท 364 views

How does Array.prototype.toReversed() avoid the classic bug of accidentally mutating a shared array reference?

Phone Screen ยท 284 views

Why would you add { passive: true } to a scroll or touchstart listener, and what problem does it solve for scroll performance?

Frontend ยท 263 views

Medium

16 questions

Hard

10 questions

Why can pushing a single non-numeric value into a large numeric array tank its performance in V8, and how would you avoid it?

System Design ยท 1.1k views

How does SharedArrayBuffer let two Web Workers share memory directly, and what race conditions do you need to guard against?

System Design ยท 1.0k views

How would you make a custom class iterable with for...of by implementing Symbol.iterator as a generator method?

DSA ยท 936 views

What is the Reflect API?

Frontend ยท 884 views

How would you write a deep-clone function that correctly handles a self-referencing (circular) object without infinite recursion?

DSA ยท 529 views

How would you implement a throttle function with configurable leading- and trailing-edge execution?

Frontend ยท 332 views

How would you transfer a large ArrayBuffer between a worker and the main thread without copying it, using postMessage's transfer list?

System Design ยท 324 views

How would you implement Symbol.asyncIterator on a class to transparently page through a paginated API with for await...of?

DSA ยท 266 views

Seen a JavaScript question that is not here? Add it and help the next candidate.

Share a question