Random round

Random Interview Mode

Five questions, sampled across categories and difficulty. Click reroll for a new set. Simulates the surface area of a typical 60-minute round.

5 questions selected

1

How would you design a frontend feature flag system?

Two flag types: release flags (kill-switch, gradual rollout — short-lived) and experiment flags (A/B with variants and metrics — bounded life). Evaluate server-side when possible to avoid bundle-time flicker; deliver to the client via a context provider and a stable hashing rule on user/session id. Bake in: targeting rules, percentage rollouts, sticky assignment, defaults that fail safe, dashboards, and a process to remove dead flags.

system-design
hard
~20 min
2

What is a service worker and what role does it play in the browser?

A service worker is a script the browser runs in the background, separate from the page, that intercepts network requests and can serve from cache, the network, or both. Enables offline mode, custom caching strategies (cache-first, network-first, stale-while-revalidate), background sync, push notifications. Lifecycle: install → activate → fetch event. Constraints: HTTPS only, no DOM access, single-threaded JS, scope = path of registration. Powers PWAs.

browser-internals
easy
~5 min
3

How do you run A/B tests in React applications?

Use a feature-flag/experiment SDK (GrowthBook, Statsig, LaunchDarkly, Optimizely, Vercel/Posthog flags). Initialize on app start with a stable user id, then read variant via a hook: `const variant = useExperiment('checkout-cta')`. Render conditionally. Track exposure + conversion to the same analytics pipeline. SSR needs the variant resolved on the server to avoid hydration flicker. Always have a kill switch.

react
medium
~5 min
4

How do you approach output prediction questions involving Promises and async behavior?

Classic 'what's the output' problems hinge on: microtask queue order (Promises before setTimeout), synchronous code first, async function continuations are microtasks, await suspends even when value is already resolved, Promise.resolve().then(...) doesn't immediately invoke. Trace stack → micro → macro and you'll predict any ordering.

javascript
easy
~12 min
5

What is the performance model behind infinite scroll and virtual lists?

Infinite scroll = paginated fetching as the user scrolls; virtualization = rendering only the visible window of items even though the data set is in memory. They're orthogonal — combine for huge datasets. Without virtualization, 10k DOM nodes destroy scroll FPS and memory. Virtualization keeps DOM constant (~20 rows) regardless of list size, at cost of complexity (item heights, scroll restoration, accessibility, focus management).

performance
easy
~15 min