Urise
  • Forum
  • Feed
  • Jobs
  • Blog
Log inGet started free
Get started free

🎨Frontend Developer

Real frontend interview questions on React, JavaScript, CSS, and performance.

Back to Prep
Table of Contents
Table of Contents (75 questions)

React

CSS

JavaScript

Performance

Accessibility

React

1.Explain the virtual DOM and how React uses it

Answer

The virtual DOM is React's in-memory tree representation of the UI. On state change React re-renders to a new tree, diffs it against the previous one (reconciliation), and applies only the minimal real-DOM mutations. Keys help it match list items correctly. This batches updates efficiently while letting developers write declarative UI code.
Asked at:MetaNetflixAirbnb
Share:

2.What are React hooks and why were they introduced?

Answer

Hooks such as useState, useEffect and useContext let function components hold state and side effects without classes. They were introduced to reuse stateful logic across components, avoid wrapper hell and confusing this and lifecycle semantics, and enable better tree-shaking and typing. Remember the rules of hooks: top-level calls only, with exhaustive effect dependencies.
Asked at:MetaAirbnbUber
Share:

3.What is the difference between useState and useReducer

Answer

useState: simple per-component state with direct setters, ideal for independent primitives and toggles. useReducer: centralizes transitions in a reducer function with dispatched actions, better for related fields, state machines, and testable update logic. Reach for useReducer when updates depend on previous state or multiple sub-values change together.
Asked at:MetaAirbnbUber
Share:

4.How do useEffect dependencies and cleanup work

Answer

The dependency array declares every reactive value the effect reads, and React reruns the effect after render whenever one changes, with an empty array running setup once. The returned cleanup function disposes subscriptions, timers, and abortable fetches before the next run and on unmount. Keep effects narrow, list honest dependencies, and satisfy the exhaustive-deps lint rule.
Asked at:MetaNetflixGoogle
Share:

5.What is the difference between useMemo and useCallback

Answer

useMemo: caches a computed value and recomputes only when dependencies change, ideal for expensive derivations and stable object identities. useCallback: caches a function instance itself, useful when passing callbacks to memoized children or effect dependencies. Profile first since needless memoization adds complexity without measurable wins.
Asked at:MetaAirbnbNetflix
Share:

6.What are practical use cases for useRef

Answer

Refs hold mutable values that persist across renders without triggering rerenders, such as DOM nodes, timers, interval ids, and previous-value snapshots. They power focus management, scroll measurement, and imperative animations alongside callback refs for dynamic attachment. Never read or write refs during render since that breaks concurrent rendering guarantees.
Asked at:MetaGoogleStripe
Share:

7.How do you avoid prop drilling with Context and composition

Answer

Prop drilling threads data through uninterested layers, so lift shared UI state into Context providers or compose with children and slots to keep intermediate components unaware. Context suits theme, locale, and auth identity while composition with render props or slots suits layout reuse. Split contexts by concern so one changing value does not rerender every consumer.
Asked at:MetaAirbnbShopify
Share:

8.What is the difference between controlled and uncontrolled components

Answer

Controlled: React state owns the input value with onChange updates, giving live validation, formatting, and disable logic at the cost of renders per keystroke. Uncontrolled: the DOM owns the value and React reads it via refs on submit, simpler for one-shot forms and file inputs. Prefer controlled for validated flows and uncontrolled for simple capture forms.
Asked at:MetaGoogleAirbnb
Share:

9.Why do list items need stable keys in React

Answer

Keys tell the reconciler which element corresponds to which prior item so state, focus, and animations survive reordering, filtering, and insertion. Stable unique ids from data preserve identity while array indices break on reorder and cause swapped state or lost focus. Mention keying by route or query to reset component state deliberately.
Asked at:MetaNetflixAirbnb
Share:

10.How do error boundaries improve resilience in React apps

Answer

Error boundaries are class components or library wrappers that catch render-time crashes in their subtree and show fallback UI instead of unmounting the whole tree. Place them per route and per risky widget so one failing chart cannot blank the page, and report caught errors with component stacks to tracking. Note they miss event-handler and async errors, which need try catch plus explicit state.
Asked at:MetaAirbnbUber
Share:

11.How do lazy loading and Suspense improve startup performance

Answer

React lazy splits heavy components into separate chunks loaded on demand while Suspense declares loading fallbacks for whatever is still resolving. Apply it to routes, modals, and below-the-fold widgets so the initial bundle stays lean, and pair with prefetch on hover or viewport entry. Handle load failures with error boundaries plus retry affordances.
Asked at:NetflixMetaAirbnb
Share:

12.What is the difference between Server Components and Client Components

Answer

Server Components: render on the server with direct backend access, zero client JavaScript for their output, and streaming delivery, ideal for data-heavy static regions. Client Components: hydrate in the browser for interactivity, effects, and browser APIs at bundle cost. Compose static server shells around small interactive client islands to minimize shipped JavaScript.
Asked at:VercelMetaNetflix
Share:

13.What are React portals and when should you use them

Answer

Portals render children into a different DOM node, such as document body, while preserving React context and event bubbling through the component tree. They solve stacking, overflow clipping, and positioning problems for modals, tooltips, and dropdowns. Manage focus trapping, escape dismissal, and scroll locking for accessible overlays.
Asked at:MetaAtlassianFigma
Share:

14.How do refs and imperative handles expose child behavior safely

Answer

Forwarding refs plus an imperative handle lets a parent trigger focused child actions like focus, scroll, or reset without reaching into internals. Keep the exposed surface tiny and documented, preferring declarative props for everything else. Overuse recreates the tight coupling React composition tries to remove.
Asked at:MetaGoogleAdobe
Share:

15.How do you manage complex global state with Zustand or Redux Toolkit

Answer

Centralize truly shared domain state in a typed store with selectors so components subscribe only to the slices they render. Normalize entities, keep server cache in a query library instead of the store, and colocate actions with reducers for traceable updates. Measure rerenders with DevTools and split selectors when broad subscriptions cause churn.
Asked at:MetaAirbnbUber
Share:

16.How do concurrent features like useTransition keep interfaces responsive

Answer

Transitions mark non-urgent updates such as filtering large lists so typing and navigation stay fluid while React renders the new state in the background. urgent state updates immediately, deferred values lag gracefully, and Suspense boundaries show pending affordances. Apply to search-as-you-type, tab switches, and heavy list renders.
Asked at:MetaVercelNetflix
Share:

17.What does React StrictMode do for you

Answer

StrictMode double-invokes renders, effects setup and cleanup, and strict-safety checks in development to surface impure logic, missing cleanups, and legacy API use. It never affects production bundles but failures under it predict real bugs in concurrent rendering. Fix flagged effects by making setup idempotent with proper teardown.
Asked at:MetaNetflixVercel
Share:

18.How do you test React components with Jest and Testing Library

Answer

Render components as users experience them, querying by role and text rather than implementation details, then assert visible outcomes and interactions. Mock network boundaries, test loading and error states, and keep tests deterministic with fake timers. High value comes from behavior coverage of critical flows, not snapshot volume.
Asked at:MetaAirbnbShopify
Share:

19.What is the difference between web components and React components

Answer

Web components: framework-agnostic custom elements with shadow encapsulation that run anywhere at the cost of sparse ecosystem and manual state wiring. React components: rich ecosystem with declarative state, concurrent rendering, and tooling, coupled to React runtimes. Wrap shared primitives as web components when multiple frameworks must consume them.
Asked at:GoogleAdobeMicrosoft
Share:

CSS

20.What is the difference between CSS Grid and Flexbox?

Answer

Flexbox lays out in one dimension (row or column) and excels at distributing space and aligning items within a line, ideal for navbars and card rows. Grid lays out in two dimensions with explicit rows and columns, ideal for page layouts and galleries. A common rule is Flexbox for components and Grid for layouts; they compose well together.
Asked at:GoogleAppleStripe
Share:

21.Explain the box model and box-sizing

Answer

The box model is content plus padding, border and margin. With content-box (the default), width covers only content so padding and border add to total size. With border-box, width includes padding and border, making layouts predictable. Most teams set global border-box and size components accordingly.
Asked at:AppleGoogleStripe
Share:

22.How do you implement responsive design?

Answer

Build mobile-first fluid layouts with relative units, flexible Grid and Flexbox, and media queries at content breakpoints rather than device sizes. Add responsive images with srcset and sizes, touch-friendly targets, and test across viewports plus zoom and reduced-motion preferences. Mention container queries for component-level responsiveness.
Asked at:AppleGoogleAmazon
Share:

23.How do specificity and the cascade resolve conflicting CSS rules

Answer

The cascade orders origins, importance, specificity, and source order, with inline styles and important declarations beating normal author rules. Specificity scores count ids, classes with attributes and pseudo-classes, then elements, so a single id outweighs many classes. Keep selectors flat and low-specificity so overrides stay predictable without specificity wars.
Asked at:GoogleAppleStripe
Share:

24.How do absolute, relative, fixed, and sticky positioning differ

Answer

Relative offsets an element from its normal place while preserving its flow space, and creates the containing block for absolutely positioned children. Absolute removes the element from flow against the nearest positioned ancestor, fixed pins to the viewport, and sticky toggles between relative and fixed within its scroll container. Choose sticky for headers that dock then release.
Asked at:AppleGoogleFigma
Share:

25.How do you center elements reliably with Flexbox

Answer

Set display flex on the parent with justify-content center on the main axis and align-items center on the cross axis for single-shot centering. For unknown-size children this beats margin auto and transform hacks because it stays in flow and responsive. Mention gap for spacing and wrapping behavior for narrow viewports.
Asked at:GoogleStripeShopify
Share:

26.How do you build page layouts with Grid template areas

Answer

Define named areas in grid-template-areas for a visual ASCII map of header, sidebar, main, and footer, then assign children with grid-area names. This makes layout intent readable and responsive rearrangement a matter of redefining the map per breakpoint. Reserve implicit placement for galleries and explicit areas for page shells.
Asked at:AppleGoogleFigma
Share:

27.What is the difference between transitions and keyframe animations

Answer

Transitions: interpolate between two states on a trigger like hover or class change, simple for micro-interactions with timing and easing control. Keyframe animations: script multi-step sequences with percentages, iteration, direction, and fill modes that can run without triggers. Prefer transitions for state feedback and keyframes for loaders and choreographed motion.
Asked at:AppleGoogleStripe
Share:

28.How do transforms and compositing keep animations at 60fps

Answer

Animating transform and opacity lets the browser composite on the GPU without reflow or repaint of surrounding layout. Promote animated layers deliberately, keep paint areas small, and verify with performance panels showing green composited layers. Avoid animating width, height, top, or left since each frame triggers costly layout.
Asked at:GoogleAppleNetflix
Share:

29.How do container queries improve on media queries

Answer

Container queries respond to the size of a component parent rather than the whole viewport, so cards and widgets adapt wherever they are placed. This makes design systems truly reusable across sidebar, grid, and full-width slots without breakpoint guessing. Pair with container-type sizing and logical properties for robust layouts.
Asked at:GoogleAppleFigma
Share:

30.How do CSS custom properties enable theming

Answer

Custom properties cascade like normal declarations and resolve at use time, so redefining a handful on a theme root re-skins every var consumer instantly. Scope tokens by component with fallbacks, toggle themes via data attributes, and drive runtime changes from JavaScript without rebuilding stylesheets. Keep token names semantic such as surface and accent rather than literal colors.
Asked at:StripeFigmaShopify
Share:

31.How does the BEM methodology keep large CSS codebases sane

Answer

BEM names classes as Block, Element, and Modifier triples that encode ownership and state in flat selectors with minimal specificity. Flat names prevent cascade surprises, grep-friendly classes speed refactors, and modifiers express variants without overrides. Enforce it with linting and component-scoped styles where useful.
Asked at:ShopifyAtlassianStripe
Share:

32.What is the difference between pseudo-classes and pseudo-elements

Answer

Pseudo-classes: style elements by state such as hover, focus-visible, or nth-child without adding markup. Pseudo-elements: style virtual parts like first-line, marker, or generated before and after content. Combine them for polished states, like focus-visible outlines plus custom markers, while keeping semantics in real elements.
Asked at:GoogleAppleStripe
Share:

33.How do stacking contexts and z-index actually work

Answer

z-index only competes within the same stacking context, and properties like opacity below one, transforms, filters, and isolation create new contexts that trap children. Debugging means walking up ancestors for context creators rather than raising numbers blindly. Keep a small token scale for layers and document which components may escape it.
Asked at:AppleFigmaGoogle
Share:

34.What is the difference between CSS Modules and CSS-in-JS

Answer

CSS Modules: scope class names per file at build time with zero runtime cost and full static extraction. CSS-in-JS: colocates dynamic styles with components using runtime or compiled interpolation, powerful for theme-driven values at bundle cost. Choose modules for performance-first apps and compiled CSS-in-JS when dynamic theming dominates.
Asked at:MetaShopifyVercel
Share:

35.What are the tradeoffs of utility-first CSS like Tailwind

Answer

Utilities speed prototyping with constrained design tokens, purgeable output, and consistent spacing without naming debates. Costs include verbose markup, learning the scale, and repeating long class strings that components should abstract. Succeed by extracting components early and configuring tokens to match the design system.
Asked at:ShopifyVercelStripe
Share:

36.How do you implement dark mode and multi-brand theming

Answer

Tokenize colors, surfaces, and elevation as custom properties, switch themes with data attributes on the root, and persist user choice with system-preference fallback. Smooth transitions, themed images and charts, and contrast-tested pairs per theme complete the job. Scope brand overrides per tenant for white-label products.
Asked at:StripeFigmaShopify
Share:

JavaScript

37.Explain closures and their use cases in JavaScript

Answer

A closure is a function bundled with references to its outer lexical scope, so inner functions retain access to outer variables after the outer function returns. Uses include data privacy via the module pattern, callbacks and event handlers, currying and partial application, memoization, and state in hooks. Warn about stale closures in effects and loops capturing loop variables.
Asked at:GoogleMetaAmazon
Share:

38.What is the difference between var, let, and const?

Answer

var is function-scoped, hoisted with undefined initialization, and allows redeclaration, which causes subtle bugs. let and const are block-scoped with a temporal dead zone; let allows reassignment while const forbids rebinding (objects still mutable). Prefer const by default, let when reassignment is needed, and avoid var in modern code.
Asked at:GoogleMicrosoftAmazon
Share:

39.What is the event loop in JavaScript?

Answer

JavaScript runs on a single thread with a call stack, task and microtask queues, and Web APIs. Synchronous code runs to completion while async callbacks resolve via the event loop, with microtasks (promises, queueMicrotask) draining before the next macrotask (setTimeout, I/O). This explains why awaited code never blocks the thread and why long synchronous loops freeze the UI.
Asked at:GoogleMetaNetflix
Share:

40.How do event bubbling, capturing, and delegation work

Answer

Events travel down through capture, hit the target, then bubble upward, and listeners can hook either phase with the capture flag. Delegation attaches one listener on a parent and matches event targets, handling dynamic children efficiently with less memory. Mention stopPropagation tradeoffs and why delegation simplifies list UIs.
Asked at:GoogleMetaAmazon
Share:

41.What is the difference between promises and async await

Answer

Promises: objects representing eventual values chained with then and catch, explicit for combinators and parallel flows. Async await: syntactic sugar that reads like synchronous code with try catch error handling, ideal for sequential logic. Use await for readability and drop to raw promises for controlled concurrency with combinators.
Asked at:GoogleMetaNetflix
Share:

42.When should you use Promise all, race, allSettled, or any

Answer

All resolves when every input succeeds and rejects fast on the first failure, ideal for dependent batches. AllSettled always resolves with per-promise outcomes for best-effort aggregation, any resolves on the first success for redundant sources, and race settles with the first outcome for timeouts. Pick by failure semantics, not habit.
Asked at:GoogleNetflixAmazon
Share:

43.What is the difference between debounce and throttle

Answer

Debounce: waits for quiet after the last call before firing, ideal for search input and resize recalculation. Throttle: fires at most once per interval during continuous activity, ideal for scroll and mousemove handlers. Implement both with timers and trailing or leading options matched to UX needs.
Asked at:GoogleMetaStripe
Share:

44.How does prototypal inheritance work in JavaScript

Answer

Objects link to a prototype that supplies shared methods, and property lookup walks the chain until found or undefined. Classes are sugar over constructor functions and prototype assignment with super wiring parent links. Prefer composition and factory clarity, using class syntax where teams expect it but understanding the underlying delegation.
Asked at:GoogleMetaMicrosoft
Share:

45.How does this binding work in JavaScript

Answer

This depends on call site: method calls bind the receiver, plain calls yield undefined in strict mode, constructors bind fresh instances, and arrow functions inherit lexically. Explicit bind, call, and apply set it manually, which explains React class handler binding rituals. Prefer arrows for callbacks and explicit binding at API boundaries.
Asked at:GoogleMetaAmazon
Share:

46.What is the difference between ESM and CommonJS modules

Answer

ESM: static import and export syntax with tree-shaking, top-level await, and browser-native support. CommonJS: dynamic require with module exports and runtime resolution, dominant in legacy Node code. Prefer ESM for new code, interop carefully at boundaries, and keep module side effects minimal.
Asked at:GoogleVercelMicrosoft
Share:

47.How do you choose between fetch and Axios for data fetching

Answer

Native fetch is dependency-free with streaming support but requires manual timeout, retry, and error-status handling. Axios adds interceptors, timeouts, request cancellation helpers, and friendlier errors at dependency cost. Standardize one client with typed wrappers, retries, and auth refresh rather than scattering raw calls.
Asked at:GoogleMicrosoftStripe
Share:

48.What is the difference between localStorage, sessionStorage, and cookies

Answer

localStorage: persists key value strings per origin across sessions with generous limits but no expiry or server visibility. SessionStorage: same API scoped to a single tab lifetime for transient flows. Cookies: small values sent with requests, supporting HttpOnly, Secure, and SameSite flags for auth. Never store tokens in web storage when HttpOnly cookies fit.
Asked at:GoogleAmazonStripe
Share:

49.What is the shadow DOM and why does it matter

Answer

Shadow DOM gives components encapsulated markup, styles, and behavior hidden from the outer document, powering native web components and elements like video controls. Slots project light DOM into shadow trees while scoped styles cannot leak either direction. Reach for it when building framework-agnostic design-system primitives.
Asked at:GoogleAppleAdobe
Share:

50.What is the difference between unit, integration, and end-to-end tests

Answer

Unit: verify isolated functions and hooks fast with mocked boundaries. Integration: verify composed modules like form plus validation plus API mocks together. End-to-end: drive real browsers through critical journeys for release confidence at higher cost and flake risk. Pyramid shape with many units, solid integration, and few E2E keeps signal high.
Asked at:GoogleMicrosoftAtlassian
Share:

51.What is the difference between interfaces and types in TypeScript

Answer

Interfaces: object-shape contracts with declaration merging and extends, idiomatic for public component props. Types: aliases for any shape including unions, tuples, and mapped forms, stronger for compositional domain modeling. Use interfaces for extensible object APIs and types for unions and transformations.
Asked at:MicrosoftStripeAirbnb
Share:

52.How do TypeScript generics make reusable components type-safe

Answer

Generics parameterize components, hooks, and utilities over element or data types so one implementation serves many shapes with full inference. Constrain with extends, default sensibly, and let call sites infer rather than annotate. Well-placed generics remove casts while preserving autocomplete and refactoring safety.
Asked at:MicrosoftStripeVercel
Share:

53.How do strict mode, narrowing, and null checks prevent runtime crashes

Answer

Strict null checks force explicit handling of nullable values while control-flow narrowing refines unions through guards, typeof, and discriminants. Exhaustiveness checks on discriminated unions turn missing cases into compile errors. Treat strict errors as bug reports and fix the model rather than asserting non-null everywhere.
Asked at:MicrosoftGoogleStripe
Share:

Performance

54.How do you optimize React performance?

Answer

Profile first with React DevTools and Lighthouse, then memoize expensive components with memo, useMemo and useCallback, virtualize long lists, code-split routes and heavy components with lazy and Suspense, optimize images with next/image and modern formats, and avoid wasted renders from inline objects or context churn. Measure before and after with Core Web Vitals (LCP, INP, CLS).
Asked at:NetflixAirbnbMeta
Share:

55.How does IntersectionObserver power lazy loading and infinite scroll

Answer

The observer fires callbacks as elements cross viewport thresholds without scroll listeners, letting images, videos, and list pages load just in time. Combine with native loading lazy, placeholder sizing to prevent layout shift, and disconnect cleanup. Gate prefetch distance by connection quality for data-sensitive users.
Asked at:GoogleNetflixPinterest
Share:

56.How do LCP, INP, and CLS measure real user experience

Answer

Largest Contentful Paint marks when the main content becomes visible, Interaction to Next Paint measures responsiveness across the interaction lifetime, and Cumulative Layout Shift sums unexpected visual movement. Budgets like fast LCP, responsive INP, and near-zero CLS map directly to perceived quality. Track field data by page template and device class, not lab averages alone.
Asked at:GoogleNetflixShopify
Share:

57.How do you apply code splitting and route-based chunking

Answer

Split at route boundaries and heavy widgets so users download only what the current view needs, with named chunks and preload hints for likely next routes. Analyze bundles to find oversized dependencies, replace moment-style giants with modular imports, and set performance budgets in CI. Verify with coverage panels showing unused bytes removed.
Asked at:NetflixMetaShopify
Share:

58.How do memoization and list virtualization tame heavy renders

Answer

Memoize expensive subtrees so unchanged props skip rerender while virtualized lists mount only visible rows with recycled DOM nodes. Measure with profiler flame graphs before optimizing, fix inline-object identity churn first, and window lists beyond a few dozen complex rows. The combo keeps 60fps scrolling on modest devices.
Asked at:NetflixMetaAirbnb
Share:

59.How do responsive images with srcset and sizes speed up pages

Answer

Srcset offers multiple resolutions and formats while sizes tells the browser the rendered slot width, so it fetches the smallest sufficient file. Serve modern formats with fallbacks, lazy-load below the fold, and set explicit dimensions to avoid layout shift. Automate generation in the build or image CDN so authors cannot forget.
Asked at:GooglePinterestShopify
Share:

60.How do bundle analyzers and tree shaking reduce shipped JavaScript

Answer

Analyzers visualize which modules dominate the bundle so barrel imports, duplicates, and polyfill bloat become obvious. Tree shaking drops unused ESM exports during minified production builds, amplified by sideEffects flags and modular imports. Enforce budgets that fail CI when chunks regress.
Asked at:GoogleVercelShopify
Share:

61.How do service workers enable offline support and smart caching

Answer

Service workers intercept network requests with scripted strategies like cache-first for assets, network-first for API data, and stale-while-revalidate for balance. Precache app shells at install, version caches for clean upgrades, and queue mutations for background sync. Scope carefully and test update flows since stale workers haunt users.
Asked at:GoogleTwitterStarbucks
Share:

62.What is the difference between SSR, SSG, and ISR

Answer

SSR: renders HTML per request for fresh personalized content at server compute cost. SSG: prerenders pages at build time for maximum speed and CDN cacheability of stable content. ISR: regenerates static pages in the background on demand, blending freshness with edge caching. Mix per route by content volatility.
Asked at:VercelNetflixAirbnb
Share:

63.What is the difference between preload, prefetch, and preconnect

Answer

Preload: fetches a critical current-page asset early with high priority, such as hero fonts or styles. Prefetch: fetches likely next-navigation resources at low priority during idle. Preconnect: warms DNS, TLS, and sockets to third-party origins before requests. Audit with network waterfalls and avoid over-prioritizing everything.
Asked at:GoogleShopifyNetflix
Share:

Accessibility

64.How do you handle accessibility in web applications?

Answer

Use semantic HTML (buttons, headings, landmarks), visible focus states, sufficient color contrast, keyboard operability for all interactions, labels for inputs, alt text for images, and ARIA only to fill genuine gaps like roles and live regions. Test with keyboard-only navigation plus a screen reader and automated checks with axe and Lighthouse in CI.
Asked at:GoogleMicrosoftApple
Share:

65.How do ARIA roles and live regions make dynamic UI accessible

Answer

Roles communicate widget semantics like dialog, tablist, or alert to assistive tech when native elements cannot express them. Live regions announce async updates politely or assertively, with atomic and relevant attributes tuning verbosity. Prefer native elements first and add ARIA only for genuine gaps, verifying with a screen reader.
Asked at:GoogleMicrosoftApple
Share:

66.How do skip links and focus traps serve keyboard users

Answer

Skip links jump past repeated navigation to main content on first Tab, essential for efficient keyboard travel. Focus traps keep modal and menu interaction cycling inside until dismissed, then return focus to the trigger. Implement with visible focus styles, escape handling, and inert background content.
Asked at:GoogleMicrosoftAdobe
Share:

67.How do you guarantee readable color contrast

Answer

Meet WCAG contrast ratios for normal and large text, test every theme including dark mode and disabled states, and never rely on color alone for meaning. Check with automated tools plus manual sampling of real screens, adding icons or text cues alongside color. Bake tokens with passing pairs into the design system.
Asked at:AppleGoogleMicrosoft
Share:

68.How do you test with screen readers effectively

Answer

Navigate full flows with at least one desktop and one mobile reader using keyboard only, checking headings order, landmarks, names, and live announcements. Pair manual passes with axe scans in CI for regressions, and include disabled users in research where possible. File semantic fixes at the component level so every consumer benefits.
Asked at:AppleGoogleMicrosoft
Share:

69.How do semantic landmarks structure a page for assistive tech

Answer

Header, nav, main, aside, and footer landmarks let screen-reader users jump between page regions and understand layout instantly. One main per page, labeled navs, and hierarchical headings complete the map. Validate by navigating the rotor or landmarks menu rather than eyeballing visuals.
Asked at:AppleGoogleMicrosoft
Share:

70.How do you respect reduced-motion preferences

Answer

Honor the reduced-motion media signal by disabling parallax, autoplay animation, and smooth-scroll effects while preserving essential state changes. Provide a manual toggle too, keep content understandable without motion, and test with OS settings enabled. Motion should enhance, never gate, comprehension.
Asked at:AppleGoogleFigma
Share:

71.How do you build accessible forms with clear error handling

Answer

Associate every input with a programmatic label, group related fields in fieldsets with legends, and announce errors via describedby plus summary regions. Validate on blur and submit with inline messages near fields, move focus to the error summary, and preserve entered values. Test the whole flow keyboard-only with a screen reader.
Asked at:GoogleMicrosoftStripe
Share:

72.How do you manage focus across SPA route changes

Answer

On navigation move focus to the new main heading with a tabindex target and update the document title so screen-reader users perceive the page change. Announce async loading states, restore scroll sensibly, and keep skip links functional per view. Without this, keyboard users stay stranded on removed content.
Asked at:GoogleMicrosoftAdobe
Share:

73.What is your strategy for meaningful alt text

Answer

Write alt that conveys the image intent in context: empty alt for decorative images, concise function for icons and buttons, and fuller descriptions for informative charts with data tables as fallback. Avoid redundant phrases like image of and keep text near the image for complex visuals. Review with images disabled to feel the experience.
Asked at:AppleGoogleMicrosoft
Share:

74.How do you design touch targets and pointer interactions accessibly

Answer

Size targets to at least platform minimums with real spacing so neighbors are not mis-tapped, and keep hover-only actions available via tap and keyboard. Support pointer, touch, and stylus with adequate hit areas and visible focus, testing on small devices one-handed. Forgiving targets reduce errors for motor-impaired and rushed users alike.
Asked at:AppleGoogleMicrosoft
Share:

75.How does useId improve accessibility in component libraries

Answer

useId generates stable unique ids that survive server rendering for pairing inputs with labels and descriptions without global counters. Library components use it for aria-labelledby and describedby wiring that stays collision-free across instances. This removes a whole class of duplicate-id accessibility bugs.
Asked at:MetaAdobeVercel
Share:

💰 Salary Insights

Frontend Developer in

Loading salary data…
View full salary data on SalaryByRole →

Platform

  • Features
  • Launch Guide
  • Weekly Battle
  • Leaderboard
  • Rules
  • Brand Attribution

Collective

  • Founders
  • Hall of Fame
  • Post Mortem
  • Events

Topics

  • Tech News

Job Hunt

  • Find Jobs
  • Interview Prep
  • Layoff Tracker

Compare

  • vs. ProductHunt
  • vs. BetaList

Company

  • About
  • Support

Legal

  • Privacy
  • Terms
  • Code of Conduct

Resources

  • Blog
  • Launch Checklist

Free Tools

  • Name Generator
  • Analytics Generator
  • OG Preview
Stay in the LoopEnter your EmailGet The Latest Updates
X (Twitter)GitHub