How to Approach a Frontend System Design Interview

Frontend system design asks you to design what runs in the browser: components, state, data flow, and the network contract behind them. This guide gives you a repeatable plan called RADIO, a 45-minute time plan, and a fully worked poll widget.

Frontend system design · foundations

Run a structured, time-boxed design conversation that ends with a clear component tree, a store shape, an API contract, and numbered budgets.

Correctness contract: The UI never shows a state the server would reject without telling the user. Every optimistic change has a rollback path, every input is reachable by keyboard, and the page stays responsive within its frame budget.

You know basic HTML, CSS, JavaScript, and one component framework such as React. You know what HTTP and JSON are. Numbers in this guide are illustrative targets, not measurements of any real product.

Many strong engineers fail frontend design rounds for one simple reason. They start coding a component, or they draw a backend with load balancers and shards. Neither is what the interviewer wants. The interviewer wants to see how you turn a vague product idea into a client architecture. That means a tree of components and a home for each piece of state. It also means a clean contract with the server, and a plan for speed, accessibility, and failure. This guide teaches a framework that keeps you on track. It also shows you what senior and staff signals look like, so you can show them on purpose instead of by luck.

Contents

  1. Concepts to understand first
  2. 1. How frontend system design differs from backend
  3. 2. The RADIO framework
  4. 3. R: Requirements and clarifying questions
  5. 4. A: Architecture and the component tree
  6. 5. D: Data model and state ownership
  7. 6. I: Interface, API, and component props
  8. 7. O: Optimizations and deep dives
  9. 8. How to state budgets with numbers
  10. 9. The 45-minute time plan
  11. 10. Signals interviewers look for at senior and staff level
  12. 11. Failure modes
  13. 12. Trade-offs
  14. 13. Summary
  15. 14. Common mistakes
  16. Worked example: design a poll widget end to end
  17. Code lab: an optimistic poll store
  18. Check yourself
  19. Key terms
  20. Further reading

Concepts to understand first

RADIO

RADIO is an ordered checklist for a frontend design answer. It stands for Requirements, Architecture, Data model, Interface, and Optimizations. Each step produces one artifact you can point at on the whiteboard.

Example. For a news feed, R gives "infinite scroll, 50 ms input response", A gives the component tree, D gives the normalized store, I gives the feed API, and O gives virtualization.

Limit. RADIO is a guide, not a script. If the interviewer pulls you into one deep dive early, follow them and return to the checklist later.

Component tree

A component tree shows which UI parts contain which other parts. It also shows where data enters the tree and which components own state.

Example. ChatApp contains ConversationList and ThreadView. ThreadView contains MessageList and Composer. Only ChatApp talks to the store.

Limit. Do not draw every button. Draw the 6 to 12 boxes that carry data, state, or a performance concern.

State ownership

Every piece of state should have exactly one owner. The owner is the only place that writes it. Other parts read it through props, context, or a store selector.

Example. The draft text of a comment belongs to the Composer. The list of comments belongs to the server cache. The open or closed state of a menu belongs to the menu.

Limit. Copying server data into local state creates two owners. They drift apart, and the user sees stale or wrong data.

Budget

A budget is a number the design must stay under. Common budgets are JavaScript size, Largest Contentful Paint, input delay, DOM node count, and memory.

Example. "Our route bundle stays under 170 KB of compressed JavaScript, so a mid-range phone can parse and run it in about one second."

Limit. A budget without a reason sounds like a guess. Always tie the number to a device, a network, or a user goal.

Optimistic update

An optimistic update changes the UI before the server confirms the change. The client keeps a snapshot so it can undo the change if the server says no.

Example. A like button turns blue at once. If the request fails after 3 seconds, it turns grey again and shows a short error.

Limit. Do not use it for actions that are hard to undo or that cost money, such as payments. Show a pending state there instead.

Interview signal

A signal is evidence the interviewer writes down about your level. They score problem framing, technical depth, trade-off reasoning, and communication.

Example. Saying "cursor pagination, because new posts at the top would shift offsets and cause duplicates" is a depth signal. Saying "we paginate" is not.

Limit. Signals come from reasons, not from buzzwords. Naming ten technologies without trade-offs scores lower than explaining two well.

1. How frontend system design differs from backend

Backend system design is about many machines serving many users. You talk about throughput, sharding, replication, and queues. The unit of scale is the cluster. Frontend system design is about one device serving one user very well. The unit of scale is the user's phone, its CPU, its memory, and its network.

This change of view changes what "hard" means. On the backend, 10,000 requests per second is hard. On the frontend, keeping one scroll at 60 frames per second on a four-year-old Android phone is hard. A frame at 60 Hz lasts about 16.7 ms. The browser needs part of that time for style, layout, and paint. So your JavaScript gets roughly 10 ms per frame during animation or scrolling.

What stays the same

What is different

Intuition

A backend designer builds a highway system for millions of cars. A frontend designer builds the dashboard of one car. The dashboard must react instantly, never lie about speed, and work for every driver, including drivers who cannot see it.

Three flavors of frontend design questions

RADIO works for all three. The weight of each step changes. A widget spends more time on Interface. An application spends more time on Data model and Optimizations.

2. The RADIO framework

RADIO gives you five steps. Each step ends with an artifact the interviewer can see. This matters because interviewers grade what they can see and hear. A clear artifact is proof that you finished the step.

  1. Requirements. Artifact: two short lists, functional and non-functional, plus a list of things out of scope.
  2. Architecture. Artifact: a component tree with layers, such as view, state, data access, and server.
  3. Data model. Artifact: a code block with the client store shape and the entity types.
  4. Interface. Artifact: API endpoints with request and response shapes, plus key component props.
  5. Optimizations. Artifact: two to four deep dives with numbers, such as performance, accessibility, or offline support.

The order follows a dependency chain. You cannot draw a tree before you know the features. You cannot shape the store before you know which components read it. You cannot design the API before you know what the store needs. You cannot optimize before you know what is slow.

Tip

Write the five letters in a corner of the whiteboard at the start. Tick each one when you finish it. The interviewer sees your plan, and you never lose your place when a question pulls you sideways.

3. R: Requirements and clarifying questions

Spend about five minutes here. The goal is to shrink an open problem into a design you can finish in 35 minutes. Every answer should remove a branch of the design.

Questions that change the design

Functional and non-functional

Functional requirements are what the user can do. Non-functional requirements are how well the system does it. Frontend non-functional requirements are usually about performance, accessibility, reliability on bad networks, security, and internationalization.

Interview

Say your assumptions as statements, not questions, when the interviewer seems neutral. "I will assume mobile web is the main target and we need SEO for public pages. Is that right?" This is faster and shows judgment.

Out of scope

Name what you will not cover. For example, "I will not design the recommendation ranking or the admin tools." This protects your time. It also shows that you can see the full system and still choose a focus.

4. A: Architecture and the component tree

Architecture on the frontend has two views. The first is the component tree. The second is the layer stack, which shows how data moves from the server to the pixels.

The layer stack

How to draw the component tree

  1. Start from the page or the host. Draw one box at the top.
  2. Split the screen into regions the user can see, such as header, list, and composer.
  3. For each region, draw the component that owns its data. Stop when a box would only hold styling.
  4. Mark the boxes that own state with a small "S". Mark the boxes that fetch with a small "F".
  5. Draw arrows from the store to the components that read it. Keep the number of reading boxes small.
  6. Note repeated children with "x N". This flags where virtualization or memoization may matter.
Component tree of a poll widget. PollWidget contains PollQuestion, OptionList with N OptionItems, and PollFooter. The widget reads a poll store, which uses an API client to call the poll service. Live count updates flow back through EventSource into the store. A guest vote flag is kept in localStorage.
Figure 1. A poll widget drawn as a component tree with its state, data access, and server layers.
Mistake

Drawing a backend diagram with load balancers, databases, and caches. Unless the interviewer asks, the server is a single box called "API". Spend your boxes on the client.

Rendering choice belongs here

State your rendering strategy in the architecture step. Choose between client-side rendering, server-side rendering, static generation, or a mix. One sentence is enough at first. "Public poll pages use server rendering for SEO and fast first paint. The voting part hydrates on the client." The rendering guide in this section covers the details.

5. D: Data model and state ownership

The data model step answers two questions. What does the client store look like? Who owns each piece of state?

Classify every piece of state

Normalize shared entities

If the same entity appears in many places, store it once by ID. A user's name may appear in a post header, a comment, and a sidebar. If you nest copies, an update must find every copy. If you normalize, one write updates every view.

// Normalized client store for a feed
type Store = {
  users: Record<UserId, User>
  posts: Record<PostId, Post>          // post.authorId points into users
  feed: { ids: PostId[], nextCursor: string | null, status: 'idle' | 'loading' | 'error' }
  pending: Record<OpId, PendingOp>     // optimistic ops waiting for the server
}
Tip

Write the store shape as a TypeScript type. It is compact, precise, and it reads like a contract. Interviewers can spot missing fields fast, which gives you useful feedback early.

6. I: Interface, API, and component props

The interface step covers three contracts. The first is the server API. The second is the real-time channel, if any. The third is the public props of key components.

Server API

For each endpoint, give the method, the path, the request body, and the response body. Mention pagination, error codes, and idempotency for writes. Keep it short. Four lines per endpoint is enough.

GET  /api/feed?cursor=abc&limit=20
  200 { items: Post[], users: User[], nextCursor: string | null }

POST /api/posts/:id/likes        headers: Idempotency-Key: <uuid>
  200 { postId, likeCount, likedByMe: true }
  409 { error: 'ALREADY_LIKED' }

Notice that the feed response returns users next to items. This side-loading lets the client normalize without a second request. It also keeps each user object in the payload only once.

Real-time channel

Pick the simplest channel that meets the freshness requirement.

Component props

For a widget question, the props are the main interface. Good props are small, typed, and controlled or uncontrolled on purpose. Show events as callbacks, such as onChange. Show render hooks only if the interviewer asks for custom rendering.

7. O: Optimizations and deep dives

The optimizations step is where senior candidates separate themselves. You pick two to four topics and go deep with numbers. Pick the topics that the problem makes hard. Do not list every trick you know.

A menu of deep dives

Interview

Ask the interviewer, "Which area would you like me to go deeper on?" Offer two options you are strong in. This turns the deep dive into a collaboration and often reveals what they are scoring.

How to structure one deep dive

  1. State the problem with a number. "A feed of 2,000 items creates about 40,000 DOM nodes."
  2. Explain why it hurts. "Style recalculation and layout scale with node count, so scroll frames exceed 16 ms."
  3. Give the fix. "Virtualize the list. Render only visible rows plus an overscan of five."
  4. Give the cost of the fix. "Find-in-page breaks, and variable row heights need measurement."
  5. Give the check. "Track INP and dropped frames in field data after the change."

8. How to state budgets with numbers

Budgets turn "make it fast" into a design constraint. A good budget has three parts: a metric, a number, and a reason. Here is how to build each common budget from first principles.

Frame budget

At 60 Hz, one frame is 1000 / 60, which is about 16.7 ms. The browser uses some of that for style, layout, paint, and compositing. Plan for 10 ms of script per frame during scrolling. On 120 Hz screens the frame is 8.3 ms, so heavy work during scroll hurts even more.

Input responsiveness budget

Interaction to Next Paint (INP) should be 200 ms or less at the 75th percentile of page loads. Any task over 50 ms is a long task. So break work into chunks under 50 ms and yield to the browser between them.

JavaScript bundle budget

Here is a worked estimate. Suppose the target is a mid-range phone on a 4G link with about 1.6 Mbps of real throughput and 150 ms round trips. You want the page interactive within about 3.5 seconds.

Payload and DOM budgets

Intuition

A budget is like a household budget. You do not say "spend less". You say "rent is 1,000, food is 400". When a new feature wants 50 KB, the team must remove 50 KB elsewhere or argue for a bigger budget.

9. The 45-minute time plan

Most loops give you 45 minutes. About 5 minutes go to introductions and 5 to your questions at the end. So you have about 35 minutes of design. Here is a plan that works.

  1. Minutes 0 to 5: Requirements. Ask four to six questions. Write functional, non-functional, and out-of-scope lists.
  2. Minutes 5 to 8: Budgets and scale. State devices, network, data size, and two or three budgets.
  3. Minutes 8 to 15: Architecture. Draw the component tree and the layers. Name the rendering strategy.
  4. Minutes 15 to 20: Data model. Write the store type. Mark the owner of each state kind.
  5. Minutes 20 to 25: Interface. Write two to four endpoints and key props. Name the real-time channel.
  6. Minutes 25 to 38: Optimizations. Do two or three deep dives with numbers and trade-offs.
  7. Minutes 38 to 42: Failure modes and wrap-up. Walk one failure end to end. Summarize the design in four sentences.
  8. Minutes 42 to 45: Questions. Ask the interviewer a real question about their frontend work.
Tip

Glance at the clock at minute 15 and minute 25. If you are behind, say so and skip ahead. "I will keep the data model brief so we have time for performance." Interviewers reward time awareness.

10. Signals interviewers look for at senior and staff level

Interviewers usually score four areas. They are problem exploration, technical design, trade-offs, and communication. The bar rises with level.

Mid level

Senior level

Staff level

Interview

A staff signal often sounds like a question to yourself. "If this widget ships on 500 pages, a 10 KB increase costs every page. So I would ship the results chart as a lazy chunk loaded only after a vote."

11. Failure modes

Name failure modes for the design, not only for the network. Here are the ones that appear in almost every frontend design.

12. Trade-offs

Optimistic versus pessimistic updates

Optimistic updates feel instant. They cost rollback logic and a moment of wrong UI on failure. Use them when success is above 99 percent and the action is cheap to undo. Use pessimistic updates for payments, deletes without undo, and permission changes.

Server rendering versus client rendering

Server rendering gives faster first paint and SEO. It costs server compute and hydration work on the client. Client rendering is simpler to host and fine for logged-in apps. It costs a slower first view on weak devices.

One global store versus local state

A global store makes cross-component updates easy and debuggable. It costs boilerplate and can cause wide re-renders. Local state is simple and fast. It gets messy when distant components need the same data.

WebSocket versus polling

WebSocket gives low latency and lower overhead per message. It costs connection management, sticky load balancing, and reconnect logic. Polling every 15 seconds is simple and cacheable. It costs freshness and some wasted requests.

Generic component versus specific component

A generic component serves many teams. It costs a larger API surface and more bundle bytes. A specific component is small and clear. It may be copied and diverge across teams.

13. Summary

14. Common mistakes

Worked example: design a poll widget end to end

The prompt is: "Design a poll widget that can be embedded in articles. Users pick one option and then see live results." Here is a full RADIO pass, timed for a 35-minute design window.

Requirements (minutes 0 to 5)

Questions asked and answers assumed:

  1. Single choice or multiple choice? Answer: single choice, with the option to change your vote before the poll closes.
  2. Who can vote? Answer: logged-in users, one vote each. Guests see results only.
  3. When are results shown? Answer: after you vote, or after the poll closes.
  4. How many options and voters? Answer: 2 to 10 options. A popular poll may get 50,000 votes in an hour.
  5. How fresh must results be? Answer: within about 5 seconds is fine.
  6. Where is it embedded? Answer: inside our own article pages, which use server rendering.

Functional requirements:

Non-functional requirements:

Out of scope: creating polls, moderation, and fraud detection on the server.

Budgets (minutes 5 to 8)

  1. Payload: 10 options at about 80 bytes each, plus the question, is about 1.2 KB of JSON. Compressed it is under 1 KB.
  2. Live updates: polling every 5 seconds from 10,000 open pages is 2,000 requests per second. That is high for a simple widget. Server-Sent Events push only on change, and the server can batch updates to one per second.
  3. DOM: 10 options at about 8 nodes each is 80 nodes. No virtualization needed.
  4. Bundle: no chart library. Bars are CSS widths with transform: scaleX() for cheap animation.

Architecture (minutes 8 to 15)

  1. The article server renders the poll HTML with the question and options. This gives instant paint and no layout shift.
  2. Results space is reserved in the server HTML. Each option row has a fixed minimum height and a bar track already present.
  3. The widget script hydrates only the poll island, not the full article. It loads with type="module" and is deferred.
  4. The component tree is PollWidget, which contains PollQuestion, OptionList, N OptionItem, and PollFooter. See Figure 1.
  5. A small poll store holds state. The widget does not need a global app store.

Data model (minutes 15 to 20)

type PollState = {
  poll: { id: string, question: string, closesAt: string, status: 'open' | 'closed' }
  options: Record<OptionId, { id: OptionId, label: string, votes: number }>
  order: OptionId[]                 // display order from the server
  total: number
  myVote: OptionId | null
  pending: { opId: string, prev: Snapshot } | null
  lastEventId: string | null        // for gap fill after reconnect
}

The server owns vote counts. The client owns pending and the selection during a request. Only one vote request may be in flight at a time. A new selection aborts the old request and restores from the oldest snapshot.

Interface (minutes 20 to 25)

GET  /api/polls/:id
  200 { poll, options, total, myVote, lastEventId }

PUT  /api/polls/:id/vote        Idempotency-Key: <uuid>
  body { optionId }
  200 { options, total, myVote }      // fresh counts
  409 { error: 'POLL_CLOSED' }

GET  /api/polls/:id/stream      (text/event-stream)
  event: counts   id: 1842   data: { options, total }

<PollWidget pollId="p1" initialData={serverJson} onVote={trackFn} />

The vote uses PUT because voting is "set my vote to X". Repeating it has the same effect, so it is naturally idempotent. The idempotency key still helps the server dedupe analytics events.

Optimizations (minutes 25 to 38)

  1. Optimistic vote. On click, add 1 to the chosen option, subtract 1 from the previous choice, and set myVote. Save a snapshot. On a 200, replace counts with the server values. On a 409 or timeout after 8 seconds, restore the snapshot and announce the error. See Figure 2.
  2. Live merge. SSE events carry absolute counts, not deltas. Absolute counts are safe to apply in any order if the client keeps the highest event ID. While a vote is pending, the client re-applies its own optimistic delta on top of incoming counts.
  3. Accessibility. Options use a native fieldset with legend and radio inputs. Native radios give arrow-key navigation for free. Results use aria-live="polite" and announce "Voted for B. B has 42 percent." Percentages are in text, not only in bar width, so color-blind users and screen readers get them.
  4. No layout shift. The server HTML reserves the bar track and the percentage slot. Revealing results only changes transform and opacity, which the compositor handles without layout.
  5. Motion and locales. Bars animate only if prefers-reduced-motion is not set. Percentages use Intl.NumberFormat with style: 'percent'. Logical CSS properties like margin-inline-start flip correctly in right-to-left.
Sequence of a vote. The user selects option B. OptionItem dispatches a vote to the store. The store applies an optimistic change and sends a PUT with an idempotency key through the API client. On success the server returns fresh totals and the store confirms. On a 409 or timeout the store rolls back to its snapshot. Finally an aria-live region announces the result.
Figure 2. The vote flow with the happy path in solid lines and the rollback path in dashed lines.

Failure modes and wrap-up (minutes 38 to 42)

  1. The user votes B, then quickly changes to C. The client aborts the B request. It keeps the original snapshot from before B, so a later rollback restores the true starting state.
  2. The SSE connection drops. EventSource reconnects and sends Last-Event-ID: 1842. The server replies with the current counts. Since counts are absolute, one event fills any gap.
  3. The poll closes while a vote is in flight. The server returns 409 POLL_CLOSED. The client rolls back, switches to the closed view, and shows final results.
  4. JavaScript fails to load. The server HTML still shows the question and a form that posts to /polls/:id/vote. Voting works with a full page reload. This is progressive enhancement.

Four-sentence summary: The poll is server rendered with reserved space, then hydrated as a small island. A tiny store owns optimistic state with one pending snapshot. Votes use an idempotent PUT, and live counts arrive as absolute values over SSE. Native radios, live regions, and logical CSS give accessibility and right-to-left support at almost no bundle cost.

Tip

A star-rating widget follows the same plan. Swap radio options for five radios in a radiogroup, keep the optimistic set-rating call, and show the average with one decimal. The main new edge case is half-star display versus whole-star input.

Code lab: an optimistic poll store

This plain JavaScript store models the vote flow from Figure 2. It keeps one snapshot, aborts superseded requests, and rolls back on failure. The fake server fails on purpose for option C. Save it as poll-store.mjs and run node poll-store.mjs with Node 18 or newer.

function createPollStore(initial, api) {
  let state = structuredClone(initial)
  let pending = null // { controller, snapshot }
  const listeners = new Set()
  const emit = () => listeners.forEach((fn) => fn(state))

  async function vote(optionId) {
    const snapshot = pending ? pending.snapshot : structuredClone(state)
    if (pending) pending.controller.abort()
    const controller = new AbortController()
    pending = { controller, snapshot }

    const next = structuredClone(snapshot)
    if (next.myVote) next.options[next.myVote] -= 1
    else next.total += 1
    next.options[optionId] += 1
    next.myVote = optionId
    state = next
    emit()

    try {
      const fresh = await api.vote(optionId, controller.signal)
      if (pending?.controller !== controller) return
      state = { ...state, ...fresh }
    } catch (err) {
      if (err.name === 'AbortError') return
      state = snapshot
      console.log('rollback:', err.message)
    }
    pending = null
    emit()
  }
  return { vote, subscribe: (fn) => listeners.add(fn), get: () => state }
}

const server = { options: { A: 10, B: 5, C: 1 }, total: 16, myVote: null }
const api = {
  vote: (id, signal) => new Promise((resolve, reject) => {
    const t = setTimeout(() => {
      if (id === 'C') return reject(new Error('POLL_CLOSED'))
      if (server.myVote) server.options[server.myVote] -= 1
      else server.total += 1
      server.options[id] += 1
      server.myVote = id
      resolve(structuredClone(server))
    }, 100)
    signal.addEventListener('abort', () => {
      clearTimeout(t)
      reject(new DOMException('aborted', 'AbortError'))
    })
  }),
}

const store = createPollStore(server, api)
store.subscribe((s) => console.log(JSON.stringify(s.options), 'mine:', s.myVote))
store.vote('A')
store.vote('B') // aborts A, keeps the original snapshot
setTimeout(() => store.vote('C'), 300) // server rejects, store rolls back

Expected behavior: you see A applied, then B applied, then B confirmed by the server. Then C is applied and rolled back to the B state. Change the 300 ms delay to 50 ms. Then C aborts the pending B request, and the rollback restores the original state from before A.

Check yourself

  1. Why does RADIO put Data model before Interface?
    Answer

    The API should serve what the client store needs. Once you know the store shape, you can design responses that fill it in one request, for example by side-loading users with posts.

  2. Your frame budget at 120 Hz is roughly how many milliseconds, and why does it matter?
    Answer

    About 8.3 ms. The browser still needs time for style, layout, and paint. So any script during scroll or animation must be very short, or it must move off the main thread.

  3. Give one senior and one staff signal for the poll widget.
    Answer

    Senior: handling a vote change during a pending request with abort and one snapshot. Staff: noting that the widget ships on many pages, so its bundle budget is a cost for every article, and proposing a lazy results chunk.

  4. Why do live updates send absolute counts instead of deltas?
    Answer

    Absolute counts are safe to apply after a missed or reordered event. The client keeps the newest event ID and replaces counts. Deltas would need every event in order, or the totals drift.

  5. When should you avoid optimistic updates?
    Answer

    When failure is common, when the action is hard to undo, or when a wrong temporary UI could cause harm. Payments, permanent deletes, and permission changes should show a pending state instead.

  6. How do you work out a JavaScript bundle budget on the whiteboard?
    Answer

    Pick a target device and network, and a time-to-interactive goal. Subtract time for the document and connection setup. Split the rest between download time, from throughput, and parse plus execute time, from device speed. The result gives a compressed size, such as about 170 KB.

Key terms

RADIO
Requirements, Architecture, Data model, Interface, Optimizations. A step order for frontend design answers.
Component tree
A diagram of which UI components contain which, and where state and data enter.
State owner
The single place allowed to write a piece of state.
Normalization
Storing each entity once by ID and referencing it by ID elsewhere.
Optimistic update
Changing the UI before the server confirms, with a saved snapshot for rollback.
Idempotency key
A unique ID sent with a write so the server applies repeats only once.
Frame budget
The time per frame, about 16.7 ms at 60 Hz, that rendering and script must share.
Long task
Any main-thread task longer than 50 ms. It delays input handling.
INP
Interaction to Next Paint. A Core Web Vital for responsiveness. Good is 200 ms or less.
Island
An interactive part of a mostly static page that hydrates on its own.
Progressive enhancement
Building a working baseline in HTML, then adding JavaScript for a richer experience.
Live region
An element with aria-live whose changes screen readers announce.

Further reading

Primary references