Medium Frontend Developer questions
260 questions · 10 points each for a correct first answer.
- 1.setTimeout vs microtasksjavascript, event-loopmedium
- 2.Closures in a var loopjavascript, closuresmedium
- 3.Stale value in useEffectreact-hooks, closuresmedium
- 4.Which CSS rule winscss, specificitymedium
- 5.Debounce vs throttle for searchjavascript, performancemedium
- 6.What INP measuresweb-performance, core-web-vitalsmedium
- 7.Event delegationdom, eventsmedium
- 8.Multiple setState callsreact, statemedium
- 9.Arrow function as an object methodjavascript, this-keywordmedium
- 10.One failed request breaks the dashboardpromises, async-javascriptmedium
- 11.What an async function returnsasync-javascript, promisesmedium
- 12.Function hoisting and letjavascript, hoistingmedium
- 13.Spread copies only one leveljavascript, immutabilitymedium
- 14.Responsive card grid without media queriescss-grid, responsive-designmedium
- 15.position: sticky does not stickcss-positioning, debuggingmedium
- 16.Ref value not shown on screenreact-hooksmedium
- 17.Resize handler that runs many timesreact-hooks, memory-leaksmedium
- 18.Syncing derived values with an effectreact-state, react-hooksmedium
- 19.Form keeps the previous user datareact, react-statemedium
- 20.Test fails before data arrivesreact-testing-library, testingmedium
- 21.toBe fails on equal objectsvitest, unit-testingmedium
- 22.Flaky end-to-end test with fixed waitsplaywright, e2e-testingmedium
- 23.Content jumps when images loadcore-web-vitals, web-performancemedium
- 24.Slow LCP from the hero imagecore-web-vitals, web-performancemedium
- 25.Caching fingerprinted bundleshttp-caching, web-performancemedium
- 26.Fixing a CORS errorcors, web-securitymedium
- 27.Where to keep a session tokenweb-security, authenticationmedium
- 28.Clickable div and keyboard usersaccessibility, semantic-htmlmedium
- 29.What showModal gives youaccessibility, htmlmedium
- 30.unknown versus anytypescriptmedium
- 31.useState in a Server Componentnextjs, react-server-componentsmedium
- 32.Secret key with NEXT_PUBLIC_ prefixnextjs, web-securitymedium
- 33.reduce on an empty arrayjavascript, arraysmedium
- 34.Which value a CSS variable takescss, css-variablesmedium
- 35.Native element or ARIAhtml-css, accessibility, ariamedium
- 36.Announcing "Added to cart"html-css, accessibility, ariamedium
- 37.Grouping radio buttonshtml-css, forms, accessibilitymedium
- 38.Autofill for an OTP fieldhtml-css, formsmedium
- 39.A PIN field on mobilehtml-css, formsmedium
- 40.Serving AVIF with a fallbackhtml-css, images, performancemedium
- 41.Images that push content downhtml-css, images, performancemedium
- 42.Order of async scriptshtml-css, performance, scriptsmedium
- 43.Showing a user commenthtml-css, dom, securitymedium
- 44.Live versus static listshtml-css, dommedium
- 45.target versus currentTargethtml-css, dom-eventsmedium
- 46.preventDefault versus stopPropagationhtml-css, dom-events, formsmedium
- 47.form.submit versus requestSubmithtml-css, forms, dommedium
- 48.tabindex="3" on a fieldhtml-css, accessibility, keyboardmedium
- 49.Skip link at the tophtml-css, accessibility, keyboardmedium
- 50.hidden versus aria-hiddenhtml-css, accessibility, ariamedium
- 51.State of a menu buttonhtml-css, accessibility, ariamedium
- 52.Loading the hero image soonerhtml-css, performance, imagesmedium
- 53.A preloaded font downloaded twicehtml-css, performance, fontsmedium
- 54.Pressing Enter in a search fieldhtml-css, formsmedium
- 55.Specificity of a nav link selectorhtml-css, cascade, selectorsmedium
- 56.Inline style versus !importanthtml-css, cascademedium
- 57.:is() versus :where()html-css, selectors, cascademedium
- 58.Styling a card that has an imagehtml-css, selectorsmedium
- 59.What flex: 1 meanshtml-css, flexboxmedium
- 60.Widths from flex-growhtml-css, flexboxmedium
- 61.Pushing one nav item to the righthtml-css, flexboxmedium
- 62.One flex item aligned differentlyhtml-css, flexboxmedium
- 63.Naming grid areashtml-css, gridmedium
- 64.A featured card that spans two columnshtml-css, gridmedium
- 65.Column width with gapshtml-css, gridmedium
- 66.Centering with one grid rulehtml-css, gridmedium
- 67.Moving an element with position: relativehtml-css, positioningmedium
- 68.An overlay that covers its cardhtml-css, positioningmedium
- 69.Icons that follow text colourhtml-css, css-valuesmedium
- 70.Width that leaves room for a sidebarhtml-css, css-valuesmedium
- 71.Font size from clamp()html-css, css-values, responsive-designmedium
- 72.Spacing that flips for Arabichtml-css, responsive-design, internationalisationmedium
- 73.Focus rings only for the keyboardhtml-css, accessibility, selectorsmedium
- 74.Resetting a propertyhtml-css, cascademedium
- 75.Why a big CSS file delays first painthtml-css, performancemedium
- 76.A print stylesheet and render blockinghtml-css, performancemedium
- 77.will-change on everythinghtml-css, performance, animationsmedium
- 78.A slow loop that resizes cardshtml-css, performancemedium
- 79.CSS variables versus Sass variableshtml-css, css-architecture, themingmedium
- 80.Reading a BEM class namehtml-css, css-architecturemedium
- 81.What CSS Modules dohtml-css, css-architecturemedium
- 82.A Tailwind colour that never appearshtml-css, tailwindmedium
- 83.Using transition: allhtml-css, animations, performancemedium
- 84.Using a feature only where it existshtml-css, css-architecturemedium
- 85.Which image srcset downloadshtml-css, images, responsive-designmedium
- 86.White scrollbars in dark modehtml-css, themingmedium
- 87.A manual dark mode togglehtml-css, theming, css-architecturemedium
- 88.Anchor target hidden under a headerhtml-css, responsive-designmedium
- 89.A swipe carousel without JavaScripthtml-css, responsive-designmedium
- 90.A small gap below an imagehtml-css, images, box-modelmedium
- 91.typeof before a let declarationjavascript, scope, hoistingmedium
- 92.Reading a var before it is setjavascript, hoistingmedium
- 93.Two counters from one factoryjavascript, closuresmedium
- 94.Keeping a balance privatejavascript, closuresmedium
- 95.this in a plain function calljavascript, thismedium
- 96.Calling bind twicejavascript, this, functionsmedium
- 97.Property found on the prototypejavascript, prototypesmedium
- 98.Arrow field versus class methodjavascript, classesmedium
- 99.null compared looselyjavascript, type-coercionmedium
- 100.Adding two arraysjavascript, type-coercion, arraysmedium
- 101.Freezing a nested configjavascript, objectsmedium
- 102.What structuredClone cannot copyjavascript, objectsmedium
- 103.Objects as keys in a plain objectjavascript, objects, mapsmedium
- 104.Attaching data to DOM nodesjavascript, maps, memorymedium
- 105.map over new Array(3)javascript, arraysmedium
- 106.slice versus splicejavascript, arraysmedium
- 107.for...in over an arrayjavascript, arrays, loopsmedium
- 108.Number versus parseInt on "12px"javascript, type-coercion, numbersmedium
- 109.includes versus indexOf with NaNjavascript, arraysmedium
- 110.Return value with finallyjavascript, errorsmedium
- 111.When the executor runsjavascript, promises, event-loopmedium
- 112.A chain after catchjavascript, promisesmedium
- 113.Order of Promise.all resultsjavascript, promisesmedium
- 114.Reading pages with for awaitjavascript, async-await, generatorsmedium
- 115.Error inside a setTimeout callbackjavascript, errors, timersmedium
- 116.Total wait with exponential backoffjavascript, async-await, resiliencemedium
- 117.Timing a JavaScript animationjavascript, browser-apismedium
- 118.Loading a chart library on clickjavascript, modules, performancemedium
- 119.An imported let that changesjavascript, modulesmedium
- 120.__dirname in an ES modulejavascript, modules, nodejsmedium
- 121.nextTick versus promise in Nodejavascript, event-loop, nodejsmedium
- 122.Wrapping an error with a causejavascript, errorsmedium
- 123.Adding a timeout to fetchjavascript, fetchmedium
- 124.Listener that will not go awayjavascript, dom-eventsmedium
- 125.Passive touch listenersjavascript, dom-events, performancemedium
- 126.Handler that should run oncejavascript, dom-eventsmedium
- 127.When Promise.any rejectsjavascript, promises, errorsmedium
- 128.An endless chain of microtasksjavascript, event-loopmedium
- 129.Resolving with two valuesjavascript, promisesmedium
- 130.What Promise.withResolvers givesjavascript, promisesmedium
- 131.Inferring a generic typejavascript, typescript, genericsmedium
- 132.Constraining a genericjavascript, typescript, genericsmedium
- 133.A typed getter with keyofjavascript, typescript, genericsmedium
- 134.Type for a PATCH bodyjavascript, typescript, utility-typesmedium
- 135.A tax-rate lookup tablejavascript, typescript, utility-typesmedium
- 136.Narrowing on a kind fieldjavascript, typescript, narrowingmedium
- 137.A function that narrows a typejavascript, typescript, narrowingmedium
- 138.Narrowing with the in operatorjavascript, typescript, narrowingmedium
- 139.The ! after a valuejavascript, typescript, strict-modemedium
- 140.satisfies versus a type annotationjavascript, typescriptmedium
- 141.Reusing a function’s return typejavascript, typescript, utility-typesmedium
- 142.Passing an object with extra fieldsjavascript, typescriptmedium
- 143.Indexing with noUncheckedIndexedAccessjavascript, typescript, strict-modemedium
- 144.Unwrapping a promise typejavascript, typescript, utility-typesmedium
- 145.Changing an object in statereact, state, immutabilitymedium
- 146.Adding to a list in statereact, state, immutabilitymedium
- 147.Removing a row from statereact, state, immutabilitymedium
- 148.Expensive initial statereact, state, performancemedium
- 149.An input that loses focus on each keyreact, components, renderingmedium
- 150.Two counters that share statereact, state, renderingmedium
- 151.Uncontrolled to controlled warningreact, formsmedium
- 152.Same key in two different listsreact, listsmedium
- 153.Passing a prop through five layersreact, components, propsmedium
- 154.When to reach for useReducerreact, hooks, statemedium
- 155.State becomes undefined after an actionreact, hooksmedium
- 156.A button inside a clickable cardreact, eventsmedium
- 157.Children re-render with the parentreact, renderingmedium
- 158.A hook inside an ifreact, hooksmedium
- 159.Two components using one custom hookreact, hooksmedium
- 160.Unique ids for a reusable fieldreact, hooks, accessibilitymedium
- 161.useFormStatus always says not pendingreact, forms, react-19medium
- 162.Showing a form action’s resultreact, forms, react-19medium
- 163.Default prop valuesreact, propsmedium
- 164.When React onChange firesreact, events, formsmedium
- 165.An effect that re-runs on every renderreact, hooks, effectsmedium
- 166.useMemo that recomputes every timereact, hooks, performancemedium
- 167.useCallback that changes nothingreact, hooks, performancemedium
- 168.A slow page from one hover statereact, performance, statemedium
- 169.Exposing only focus() from a componentreact, hooks, refsmedium
- 170.Cleaning up a window listener in an effectreact, effects, eventsmedium
- 171.Rendering 20,000 rowsreact, performance, listsmedium
- 172.Where to split a bundle firstreact, performance, code-splittingmedium
- 173.A Server Component inside a client wrapperreact, server-componentsmedium
- 174.Security of a Server Functionreact, server-components, securitymedium
- 175.staleTime versus gcTimereact, data-fetchingmedium
- 176.Wrong orders shown for a new filterreact, data-fetchingmedium
- 177.userEvent versus fireEventreact, testingmedium
- 178.Testing text that appears after a fetchreact, testingmedium
- 179.The "not wrapped in act" warningreact, testingmedium
- 180.A store hook that re-renders too oftenreact, state-management, performancemedium
- 181.What the React Compiler doesreact, performance, toolsmedium
- 182.A tab switch that freezes the pagereact, hooks, performancemedium
- 183.dispatch in a dependency arrayreact, hooksmedium
- 184.The memo compare functionreact, performancemedium
- 185.Flexbox defaults in React Nativereact, react-nativemedium
- 186.Different code for iOS and Androidreact, react-nativemedium
- 187.Sharing logic: hook or HOCreact, patterns, hooksmedium
- 188.What a render prop isreact, patternsmedium
- 189.Building <Tabs> with <Tabs.Tab>react, patterns, contextmedium
- 190.Supporting both controlled and uncontrolledreact, patterns, formsmedium
- 191.Where focus goes after a modalreact, accessibilitymedium
- 192.A big form that re-renders on each keyreact, forms, performancemedium
- 193.Filters lost on refreshreact, state, routingmedium
- 194.A list that stops updatingreact, data-fetching, statemedium
- 195.Computing one layout shiftweb-performance, core-web-vitalsmedium
- 196.What can be the LCP elementweb-performance, core-web-vitalsmedium
- 197.Raising the hero image priorityweb-performance, resource-hintsmedium
- 198.preload versus prefetchweb-performance, resource-hintsmedium
- 199.Console warning after preloadweb-performance, resource-hintsmedium
- 200.Default behaviour of module scriptsweb-performance, scriptsmedium
- 201.Inlining critical CSSweb-performance, critical-rendering-pathmedium
- 202.dns-prefetch or preconnectweb-performance, resource-hintsmedium
- 203.Computing Total Blocking Timeweb-performance, main-threadmedium
- 204.Parts of an interactionweb-performance, core-web-vitalsmedium
- 205.Breaking up a long handlerweb-performance, main-threadmedium
- 206.Reading LCP in codeweb-performance, measurementmedium
- 207.Collecting real-user metricsweb-performance, measurementmedium
- 208.Redirect chain hurts TTFBweb-performance, networkmedium
- 209.Page not restored on Backweb-performance, cachingmedium
- 210.Instant next-page loadsweb-performance, resource-hintsmedium
- 211.Skipping off-screen renderingweb-performance, renderingmedium
- 212.Heavy chat widgetweb-performance, third-partymedium
- 213.Clicks ignored after loadweb-performance, main-threadmedium
- 214.Lazy loading every imageweb-performance, imagesmedium
- 215.stale-while-revalidateweb-performance, cachingmedium
- 216.Caching the HTML pageweb-performance, cachingmedium
- 217.Getting sizes rightweb-performance, imagesmedium
- 218.Origin load from hit ratioweb-performance, cachingmedium
- 219.Low CDN hit ratioweb-performance, cachingmedium
- 220.Large font for a few scriptsweb-performance, fontsmedium
- 221.When to pick font-display: optionalweb-performance, fontsmedium
- 222.Many weights of one fontweb-performance, fontsmedium
- 223.Self-hosting Google Fontsweb-performance, fontsmedium
- 224.Users stuck on old versionweb-performance, service-workersmedium
- 225.New service worker waitsweb-performance, service-workersmedium
- 226.Domain sharding todayweb-performance, networkmedium
- 227.Small file, slow pageweb-performance, imagesmedium
- 228.Different crop for phonesweb-performance, imagesmedium
- 229.Changing a file at the same URLweb-performance, cachingmedium
- 230.Savings from Brotliweb-performance, compressionmedium
- 231.Encoding images on uploadweb-performance, imagesmedium
- 232.Heavy animated GIFweb-performance, imagesmedium
- 233.Three map embeds below the foldweb-performance, third-partymedium
- 234.Icon font for 20 iconsweb-performance, imagesmedium
- 235."sideEffects": falseweb-performance, bundlersmedium
- 236.Why CommonJS shakes poorlyweb-performance, bundlersmedium
- 237.Vendor chunk hash changesweb-performance, bundlersmedium
- 238.Two copies of one libraryweb-performance, npmmedium
- 239.Finding why a package is installedweb-performance, npmmedium
- 240.Forcing a nested versionweb-performance, npmmedium
- 241.Does devDependencies keep code out?web-performance, npmmedium
- 242.Leak through a closureweb-performance, memorymedium
- 243.Timer survives the componentweb-performance, memorymedium
- 244.Caching data per DOM elementweb-performance, memorymedium
- 245.Removing many listeners at onceweb-performance, memorymedium
- 246.Low-priority background workweb-performance, main-threadmedium
- 247.Moment.js in the bundleweb-performance, bundlersmedium
- 248.Why esbuild is fastweb-performance, build-toolsmedium
- 249.Polyfills nobody needsweb-performance, build-toolsmedium
- 250.npm audit fix --forceweb-performance, npmmedium
- 251.Package not found in a monorepoweb-performance, npmmedium
- 252.Finding unused JavaScriptweb-performance, bundlersmedium
- 253.Touch listener slows scrollingweb-performance, main-threadmedium
- 254.Large CSS from a UI kitweb-performance, build-toolsmedium
- 255.Staying within a JS budgetweb-performance, budgetsmedium
- 256.Biggest weight in Lighthouseweb-performance, measurementmedium
- 257.Limiting layout workweb-performance, renderingmedium
- 258.Polling an API that rarely changesweb-performance, cachingmedium
- 259.Faster clicks on linksweb-performance, resource-hintsmedium
- 260.Serving AVIF from one URLweb-performance, cachingmedium