Frontend Developer question bank
100 questions. Filter by level and skill, track what you've solved, and see how many people get each one right.
- Semantic element for site navigation
- Width with border-box
- Block scope of let
- Loose vs strict equality
- Centering with Flexbox
- Why React lists need keys
- Alt text for a decorative image
- Sync code runs before promise callbacks
- Linking a label to an input
- Default type of a form button
- What 1rem is relative to
- Where absolute elements are placed
- Hiding an element but keeping its space
- typeof null and arrays
- Changing a property of a const object
- Grid columns with fr units
- Media query for mobile-first CSS
- Page looks zoomed out on phones
- Numbers saved in localStorage
- What fetch does on a 404
- Input that ignores typing
- Changing a prop inside a child
- Inspecting an API response
- Installing a test-only package
- Tailwind md: prefix
- TypeScript types at runtime
- Optional chaining on missing data
- ?? versus || with zero
- Choosing a heading level
- Minimum text contrast for WCAG AA
- Native lazy loading for images
- What defer does on a script
- Order of click handlers
- Sorting numbers without a comparator
- setTimeout vs microtasks
- Closures in a var loop
- Stale value in useEffect
- Which CSS rule wins
- Debounce vs throttle for search
- What INP measures
- Event delegation
- Multiple setState calls
- Arrow function as an object method
- One failed request breaks the dashboard
- What an async function returns
- Function hoisting and let
- Spread copies only one level
- Responsive card grid without media queries
- position: sticky does not stick
- Ref value not shown on screen
- Resize handler that runs many times
- Syncing derived values with an effect
- Form keeps the previous user data
- Test fails before data arrives
- toBe fails on equal objects
- Flaky end-to-end test with fixed waits
- Content jumps when images load
- Slow LCP from the hero image
- Caching fingerprinted bundles
- Fixing a CORS error
- Where to keep a session token
- Clickable div and keyboard users
- What showModal gives you
- unknown versus any
- useState in a Server Component
- Secret key with NEXT_PUBLIC_ prefix
- reduce on an empty array
- Which value a CSS variable takes
- Cause of a hydration mismatch
- Avoiding layout thrashing
- Race condition in data fetching
- Why React.memo did not help
- z-index that does not work
- Preventing XSS from user HTML
- Reducing the initial bundle
- Losing this when a method is extracted
- Ellipsis that never truncates in Flexbox
- Every context consumer re-renders
- Effect that fetches forever
- Tooltip flashes in the wrong place
- Janky slide-in animation
- Order of logs around await
- Order of object keys
- map with parseInt
- A CSP that stops injected scripts
- CSRF risk left with SameSite=Lax
- Unsafe postMessage listener
- Slow click handler hurts INP
- Layout shift when the web font loads
- Old version after deploy with a service worker
- Typing lags while a big list filters
- Optimistic like button done right
- Memory grows in a single-page app
- Importing one function pulls a whole library
- Cascade layers versus specificity
- Card layout based on its own width
- Exhaustive check with never
- When extra properties are an error
- Status message screen readers miss
- Comparator that returns a boolean