FlexQ

Interview questions

Frontend system design interview questions

A frontend system design interview asks you to design the client side of a product: components, state and data flow, the API contract, performance, accessibility and failure states. It is a conversation about trade-offs. Start with requirements, then go deep where the interviewer steers you.

For live interviews: the FlexQ interview copilot for Mac or Windows, 30 free live minutes.

Updated 2026-11-23 · 20 questions · junior, mid-level, senior and a hands-on round · a model answer and what the interviewer is checking for each

A structure that works for most questions: clarify requirements and constraints (devices, scale, offline, accessibility); sketch the component tree; define state and where it lives; agree the API between client and server; then cover performance, accessibility, error states and how you would measure success. For the server side of a design, see the system design interview questions.

Jump to: Junior · Mid-level · Senior · Hands-on round · How to practice · FAQ

Junior and early-career questions

Juniors usually get a lighter version: one page or one feature, with the focus on components, data loading and states.

1. How would you split a product listing page into components?

Model answer: I would start from the screen and name the pieces: a page component that owns data loading, a filter panel, a sort control, the product grid, a product card and pagination. Data flows down as props, and filter and sort changes flow up as callbacks to the page, which refetches. Filter, sort and page live in the URL query string, so the view can be shared and survives a refresh. The card is the most reused part, so I keep it presentational, with no data fetching inside.

What the interviewer is checking: Clear boundaries between data and presentation, and state in the right place.

2. How would you load data for a page and handle every state?

Model answer: Every request has at least four states: loading, success with data, success but empty, and error, and the design needs all of them. For loading I prefer skeletons shaped like the content, to avoid layout shifts. Errors get a message and a retry button, and an empty result gets a helpful message rather than a blank area. A query library or the framework's loader handles caching and retries, and cancels stale requests when the user navigates away.

What the interviewer is checking: Whether you design beyond the happy path.

3. How would you make an image-heavy page load fast?

Model answer: Serve images in modern formats such as AVIF or WebP at the sizes the layout needs, with srcset and sizes so a phone does not download a desktop image. Set width and height or an aspect-ratio so the layout does not shift as images arrive. Lazy-load images below the fold with loading="lazy", but load the main above-the-fold image eagerly with fetchpriority="high", because it is often the Largest Contentful Paint. Serve everything from a CDN with long cache headers.

What the interviewer is checking: Practical performance knowledge tied to Core Web Vitals.

4. Where would you store a user's theme preference, and how do you avoid a flash of the wrong theme?

Model answer: Default to the system setting through the prefers-color-scheme media query. Save an explicit choice in localStorage, or on the server if it should follow the user across devices. The flash happens when the page renders before the script that applies the theme, so apply it before first paint: a tiny inline script in the head, or, with server rendering, a cookie the server reads to render the right theme from the start. Theme colors should be CSS variables so switching is one attribute change.

What the interviewer is checking: Attention to a small detail users notice, and knowing render order.

5. When would you choose client-side rendering, server-side rendering or static generation?

Model answer: Static generation builds HTML at deploy time: fastest and cheapest, best for content that is the same for everyone, such as docs or marketing pages. Server-side rendering builds HTML per request: good for pages that need fresh or personalized data and search visibility, at the cost of server work. Client-side rendering sends a shell and renders in the browser: fine for an app behind a login where search engines do not matter. Most real products mix them by route.

What the interviewer is checking: Matching the rendering strategy to the page, not to a favorite framework.

Mid-level frontend system design questions

Mid-level questions are a full feature with real data, real-time behavior or offline needs.

6. Design a comment thread with nested replies.

Model answer: I would store comments normalized by ID, each with a parent ID, instead of a deeply nested tree, so updating one comment does not rewrite the structure. Top-level comments load with cursor pagination and replies load per thread on demand, with a depth limit after which the thread continues on its own view. Posting is optimistic: the comment appears at once with a pending state and is replaced by the server's version or rolled back on error. For accessibility, each reply level is a nested list and focus moves to the new comment after posting.

What the interviewer is checking: Data modelling on the client, pagination and optimistic updates.

7. Design a data table with sorting, filtering and tens of thousands of rows.

Model answer: The first question is where the data lives. For a few thousand rows, client-side sorting and filtering is fine; for more, the server does it and the client sends sort, filter and cursor parameters. Rendering uses virtualization, so only visible rows are in the DOM. Sort and filter state lives in the URL, column widths and visibility in user preferences. The table uses real table markup, or the ARIA grid pattern if cells are interactive, with sortable headers that announce their state.

What the interviewer is checking: Asking about scale first, and combining performance with accessibility.

8. How would you add real-time updates, such as notifications or chat?

Model answer: Choose the transport by need. WebSockets for two-way, frequent messages such as chat; Server-Sent Events for one-way server-to-client streams, which are simpler and reconnect automatically; polling when updates are rare or infrastructure is limited. Whatever the transport, plan for reconnection with backoff, catching up on missed events with a cursor or last event ID, deduplicating by message ID, and ordering by server timestamps or sequence numbers rather than arrival order.

What the interviewer is checking: The failure cases of real-time systems, not just "use WebSockets".

9. Design offline support for a notes app.

Model answer: A service worker caches the app shell so the app opens without a network. Notes live in IndexedDB as the local source of truth, and the UI reads from there. Edits made offline go into a queue of changes that syncs when the connection returns, with retries. The hard part is conflicts when the same note changed on two devices: last-write-wins is simple but loses edits, so for real collaboration I would use per-field merges or a CRDT library such as Yjs or Automerge. The UI should show what is not yet synced.

What the interviewer is checking: Whether you get to conflict resolution, the real problem.

10. How would you design the API contract between the frontend and backend for a new feature?

Model answer: I would design it from the screens: what data each view needs, in one request where possible, so the client does not stitch together many calls. Pagination uses cursors, errors have one consistent shape with a machine-readable code, and every field is typed in a shared schema such as OpenAPI or GraphQL, from which the client types are generated. Writes should be idempotent or carry an idempotency key, so a retry after a timeout does not create duplicates. If many clients need very different shapes, a backend-for-frontend layer can adapt them.

What the interviewer is checking: Thinking across the boundary instead of taking the API as given.

11. When would you use optimistic updates, and how do you roll them back?

Model answer: Use them when the action almost always succeeds and the user expects an instant response: likes, toggles, reordering, sending a message. Update the local cache at once, keep a snapshot of the previous state, send the request, and on error restore the snapshot and tell the user what failed. Avoid them when failure is common or costly, such as payments, where a clear pending state is more honest. Query libraries such as TanStack Query support this pattern directly.

What the interviewer is checking: Judgment about when the pattern is right and how to keep it correct.

Senior frontend system design questions

Senior questions are large products or platforms used by many teams, where the trade-offs are organizational as well as technical.

12. Design the frontend of a collaborative document editor.

Model answer: The core decision is how concurrent edits merge: operational transformation with a central server, or CRDTs such as Yjs that merge on any peer and work offline. The editor itself is usually built on an editor framework such as ProseMirror or Lexical rather than raw contenteditable. Presence, meaning cursors and selections of others, travels on the same real-time channel but is not persisted. I would also cover large documents (render only what is visible), undo that only reverts your own changes, permissions, and reconnecting after a long time offline.

What the interviewer is checking: Depth on the hard part and awareness of existing building blocks.

13. Design a component library and design system used by many product teams.

Model answer: Design tokens (color, spacing, type) are the base, exposed as CSS variables so theming and dark mode work without rebuilding components. Components own their accessibility: keyboard behavior, focus and ARIA are built and tested once. The library is versioned with semantic versioning and a changelog, breaking changes come with codemods and a deprecation period, and documentation with live examples is part of the product. I would measure adoption and collect the cases teams work around, because those show what the library is missing.

What the interviewer is checking: Thinking of a library as a product with users, versions and support.

14. When are micro-frontends worth it, and how would you build them?

Model answer: They are worth it when many teams need to release parts of one product independently and a shared release train is the bottleneck; for one or two teams, a well-structured single app is cheaper. Options range from separate apps per route behind one domain, which is the simplest, to runtime composition with Module Federation or web components. Agree on shared dependencies, a common design system, routing ownership and a performance budget, or users download three copies of the same framework.

What the interviewer is checking: Honesty about the cost, which interviewers value more than enthusiasm.

15. Design a video player page for a streaming service.

Model answer: Video is delivered with adaptive bitrate streaming, HLS or DASH, where the player switches between quality levels as bandwidth changes; outside Safari's native HLS support this runs through Media Source Extensions with a library such as hls.js or Shaka Player. The page loads the player and the first segment as early as possible and defers everything else, such as comments and recommendations. Controls must work with a keyboard and screen readers, with captions and their styling. I would track start-up time, rebuffering and errors per device to steer the work.

What the interviewer is checking: Domain knowledge plus a focus on what the user experiences.

16. Design an analytics dashboard with many widgets and shared filters.

Model answer: Shared filters such as the date range live in the URL, so a dashboard can be shared exactly as seen. Each widget fetches its own data through a query cache keyed by the filters, so widgets load independently, one failure does not break the page, and identical requests are deduplicated. Widgets below the fold load when they scroll into view. Heavy data transforms run in a Web Worker, and charts with many points use canvas rather than SVG. Every chart gets a data table alternative for screen reader users.

What the interviewer is checking: Isolation of failures, performance at scale and accessibility of data.

17. How would you build internationalization into a large app?

Model answer: Strings live in message catalogs with keys, in ICU message format so plurals, gender and variables are handled per language rather than by string concatenation. Dates, numbers and currencies use the built-in Intl APIs with the user's locale. Layout uses CSS logical properties such as margin-inline-start, so right-to-left languages work by setting dir="rtl". Each locale's messages load on demand, and a check in CI catches missing translations and text that would overflow.

What the interviewer is checking: Knowing that i18n is more than translating strings.

18. How do you set and enforce performance budgets across many teams?

Model answer: Agree on a few user-facing targets, such as the Core Web Vitals at the 75th percentile from real-user monitoring, plus build-time budgets for JavaScript size per route. Enforce the build budgets in CI, so a pull request that exceeds them fails or needs an explicit sign-off. Show field data per route and per team on a shared dashboard, so each regression has an owner. Budgets work when they are few, visible and enforced automatically.

What the interviewer is checking: Turning performance into a process rather than a one-off project.

Hands-on round

Some loops add a short coding task on a piece of the design. These two come up often.

19. Implement a virtualized list with fixed row height.

Model answer: Only the rows inside the viewport, plus a few extra (overscan), are rendered. A tall inner element keeps the scrollbar correct, and each visible row is positioned absolutely at index * rowHeight. On scroll, recompute the first and last visible index. Mention the next steps: variable row heights need measured or estimated sizes, and screen readers only see rendered rows, so set aria-rowcount and aria-rowindex or offer a paginated alternative.

function VirtualList({ items, rowHeight, height, renderRow }) {
  const [scrollTop, setScrollTop] = useState(0);
  const overscan = 5;
  const start = Math.max(0, Math.floor(scrollTop / rowHeight) - overscan);
  const end = Math.min(items.length, Math.ceil((scrollTop + height) / rowHeight) + overscan);

  return (
    <div
      style={{ height, overflowY: 'auto' }}
      onScroll={(e) => setScrollTop(e.currentTarget.scrollTop)}
    >
      <div style={{ height: items.length * rowHeight, position: 'relative' }}>
        {items.slice(start, end).map((item, i) => (
          <div
            key={item.id}
            style={{ position: 'absolute', top: (start + i) * rowHeight, left: 0, right: 0, height: rowHeight }}
          >
            {renderRow(item)}
          </div>
        ))}
      </div>
    </div>
  );
}

What the interviewer is checking: The core idea of virtualization and awareness of its accessibility cost.

20. Trigger loading the next page when the user nears the end of a list.

Model answer: Put an empty sentinel element after the last item and watch it with an IntersectionObserver; a rootMargin starts loading before the user actually reaches the end. This avoids scroll event handlers on the main thread. Guard against loading the same page twice while a request is in flight, stop observing when there are no more pages, and keep a visible "Load more" button as a fallback for keyboard users and when the observer fails.

let loading = false;
const sentinel = document.querySelector('#list-end');

const observer = new IntersectionObserver(async ([entry]) => {
  if (!entry.isIntersecting || loading) return;
  loading = true;
  const hasMore = await loadNextPage();
  loading = false;
  if (!hasMore) observer.disconnect();
}, { rootMargin: '400px' });

observer.observe(sentinel);

What the interviewer is checking: Using the right browser API and handling the race and the end of the list.

How to practice

Pick three questions, set a 45-minute timer for each and talk through the structure above out loud, drawing the component tree on paper as you go. Rehearse out loud with the free voice mock interviewer at interview.flexq.app: paste the job description, add your résumé if you like, and answer by voice (typing works too). It follows up where an answer is thin and ends with a scored report that quotes your answers back. Three mock interviews are free with an email sign-up, no card.

During the real interview, the FlexQ interview copilot can show short cues on the interviewer's questions, grounded in your résumé and the job post, and you answer in your own words. Follow the rules of the company you're interviewing with.


Practice a free mock interview

Paste a senior frontend job description and your résumé, and the mock interviewer asks about systems you built and follows up on your trade-offs. Three mock interviews are free with an email sign-up, no card.

For live interviews: the FlexQ interview copilot for Mac or Windows, 30 free live minutes.

On the real call

FlexQ also has a live copilot for macOS and Windows. Add your résumé and the job description, and when a question like these lands it shows a short cue from your own experience, so you answer in your own words. Your first 30 live minutes are free. Get FlexQ.

FAQ

How is frontend system design different from backend system design?

It focuses on the client: components, state, data fetching, rendering strategy, performance, accessibility and offline behavior. Backend system design covers servers, databases, queues and scaling, which the frontend round touches only at the API boundary.

Who gets a frontend system design interview?

Mostly mid-level and senior frontend engineers. Junior candidates sometimes get a lighter version, such as designing one page or one component.

How long is a frontend system design interview?

Usually 45 minutes to an hour. Spend the first few minutes on requirements, most of the time on the component, state and API design, and the end on performance and failure cases.

Do I need to draw diagrams?

Usually yes: a component tree and a data-flow sketch, on a whiteboard tool or shared document. Neat boxes matter less than talking through each decision as you draw it.

How do I prepare for a frontend system design interview?

Practice a fixed structure on the common questions here, out loud and against a timer. Then explain a frontend you built yourself, including what you would change now.

Related

Frontend topics: React · JavaScript · TypeScript · Webpack, Vite and tooling · Frontend developer

More: Software engineer questions · System design interview questions · "Tell me about yourself" · Practice out loud · All interview questions