Frontend System Design
Designing one browser application end to end: component boundaries, where state lives, the API contract, caching, live updates and rendering per page. Rounds grade trade-offs, not framework recall.
on this pageshowhide
explore
- Interview Method5 questions
- Component Architecture at Scale5 questions
- State Placement & Sync6 questions
- Client-Server API Contract6 questions
- Caching & Offline-First6 questions
- Real-Time UI Updates6 questions
- Collaborative Editing6 questions
- Rendering Strategy Trade-offs6 questions
- Lists, Feeds & Virtualization6 questions
- Typeahead & Search UI6 questions
- File Upload Flows6 questions
- Error Reporting & Telemetry6 questions
questions
70 · 12 sectionsIn a frontend system design round, what does each stage of the RADIO frame produce when the product runs in a browser?
basics
~20 sRequirements give a list of functional and non-functional needs; architecture, a client diagram with the server as one box; data model, entities tagged by origin; interface, HTTP calls plus component inputs and events; deep dives, one or two key areas.
In a frontend design round for a hotel-booking web app, which clarifying questions change the design, and how does each answer change it?
basics
~10 sAsk what forks the design: device mix, network quality, search-engine traffic, languages and right-to-left, accessibility, data volume per screen, offline needs. Each answer moves a decision: first-response content, script weight, layout mirroring, paging, scope.
In a frontend design round for a hotel-booking web app, how do you turn 'it must be fast and accessible' into requirements that change the design?
basics
~20 sMake each one measurable for the real users: Core Web Vitals targets at the 75th percentile on mobile, and a commitment that keyboard and screen-reader users can book. Then trace each target to a concrete choice in the design.
With about twenty minutes left in a hotel-booking web app's frontend design round, which one or two deep dives would you open, and why?
basics
~20 sOpen the areas the stated requirements make hardest: how the results and hotel pages reach crawlers and low-end phones quickly, then the booking form on flaky networks. Skip styling, tooling and framework debates, and say why you chose.
Twenty minutes into a hotel-booking web app's frontend design round, you've named a framework, drawn load balancers and debated button styles. How do you recover?
basics
~20 sSay you are bringing it back to the client, redraw the client diagram with the server as one box, catch up the data model and interface, then open one deep dive, stating a trade-off for every choice from here on.
In a B2B web admin console's orders screen — grid, filter bar, bulk-actions bar, side panel — which components should own data, and which only render?
basics
~20 sA few region-level owners hold the data: the orders page owns filters, sort, selection and the list query, and a side-panel container fetches the selected order. The grid, filter bar, bulk-actions bar and panel body only render inputs and report intent.
On a B2B admin console's orders grid, should sort, filters and row selection be owned by the grid, by the page, or by the URL?
basics
~20 sDecide per value: sort and filters go in the URL because links, reload and Back must reproduce the view; the page holds the selection that the bulk-actions bar reads; open menus and focus stay inside the grid.
In a B2B web console, an order-summary panel reused on checkout review, the order page and account history has grown eleven per-screen flags; what went wrong, and what would you change?
basics
~20 sThe shared panel learned about its callers: teams added flags instead of composing, leaving untested combinations and no owner. Keep a core that renders lines and totals, and let each screen compose its own data mapping and actions.
For a 40-engineer web admin console, how would you layer components from design-system primitives to pages, and where does the design system's edge sit?
basics
~20 sFour layers, imports pointing down: design-system primitives know no domain, app-shared composites know app conventions, feature components know their domain and data, pages own routes and the URL. Wrap the system for real defaults; never restyle its internals.
In one web admin console codebase shared by five feature teams of 40 engineers, how would you draw feature-module seams and keep them from eroding?
basics
~20 sGroup code by feature, give each feature one public entry as its only importable surface, keep a small owned shared kernel, and enforce the seams with an import-boundary build rule whose baseline of old violations only shrinks.
In a frontend design round for a web email client, how do you decide where each piece of state lives?
basics
~20 sCut server data from client-only state first: mail, counts and labels live in a client cache of server data; folder, thread and filters go in the URL; one-widget state stays local; shared UI state in an app store; preferences persist.
When a web email client is open in several tabs, which state should sync between them, which must not, and how would you carry it?
basics
~20 sSync what describes the account, not the tab: sign-out, read flags and unread counts, preferences. Never sync the open draft, selection or filters. Post small change notices on a BroadcastChannel, treat them as hints, and revalidate from the server.
In a web email client, how do you decide which state is tied to the current route and which the app shell holds across navigation?
basics
~20 sAsk what the user expects after navigating away, pressing Back, reloading or sharing a link. The open thread and filters are route-keyed, in the address; a minimised draft, a sent notice and the layout preference are shell-held.
In a web email client, opening a thread marks it read, yet the list row stays bold and the folder count is unchanged; how would you redesign the state so every view agrees?
basics
~20 sKeep one record per conversation, keyed by id, that the list row and thread header both read; carry the folder count from the server with a local delta applied alongside the flag. A failed write then reverts every view at once.
In a single-user kanban board web app, what should enter the undo history, where should it live, and how does undo meet changes the server already saved?
basics
~20 sRecord intents that change the board, such as moving, creating or editing a card, never selection or filters. Keep one board-scoped history in shell-held memory, leave typing to the field's own undo, and reverse saved changes with a new write.
In a retail-banking web app, how should the API's error envelope map onto the transfer form's field errors, page failures, retries and expired sessions?
basics
~20 sUse one envelope everywhere, problem details with a stable type and per-field errors, and map by status and type: 422 field errors inline, 401 to re-authentication keeping the draft, 503 or a lost response to a retry, the rest to a page-level state.
In a frontend design round for a retail-banking web app, how would you choose REST, GraphQL or RPC for its overview, transactions and transfer screens?
basics
~20 sArgue it from the screens: the transactions list is a filtered, paged resource (REST), the transfer is a command (an action endpoint), and the overview's three-source fan-in decides whether GraphQL or one screen-shaped endpoint earns its cost.
For a retail-banking web app's transactions list and detail panel, how would you shape the payloads and page envelope against over- and under-fetching?
basics
~20 sGive list rows a summary representation that already carries the labels they display, fetch the detail when a row opens, and return a page envelope of cursor and has-more, adding a total count only if the screen shows it.
For a retail-banking web app whose overview combines balances, cards and offers from three back-end services, should the frontend team build a BFF, and what would it own?
basics
~20 sYes for this overview: three services with their own auth and error shapes, fanned in over phone networks. A frontend-owned BFF composes one screen-shaped payload and one error envelope; business rules stay in the services. Skip it if the API already serves that endpoint.
In a retail-banking web app, the offers service behind the accounts overview is down; what should the overview's API response carry, and what should the screen render?
basics
~20 sReturn the overview with balances and cards, and mark the offers section unavailable and retryable, rather than failing the whole response or sending an empty list. The screen renders what arrived and degrades the offers slot; a balances failure justifies a page-level error.
For a gradebook web app on patchy school Wi-Fi, which caching strategy should its timetable, rosters, photos, grade history and parent messages each get?
basics
~20 sArgue each resource from tolerable staleness, privacy and whether the lesson can go on without it: timetable and grade history stale-while-revalidate, rosters network-first with a short timeout, photos cache-first on versioned URLs, parent messages network-only and never stored.
In a gradebook web app open in several tabs, how would you design the offline write queue's ordering and idempotent replay, and which tab replays it?
basics
~20 sStore each write durably before showing it, ordered per target, carrying an idempotency key minted at creation; one context replays under a named Web Lock, triggered from the page whether or not Background Sync exists.
When a gradebook web app loses school Wi-Fi mid-lesson, what should the teacher see, and which actions should stay available or be disabled?
basics
~20 sKeep the lesson going: attendance and grades still save, each marked as not yet sent; cached rosters show their age; only live-only features such as parent messages are disabled with a reason. Treat navigator.onLine as a hint, never a gate.
In a gradebook web app, a grade entered offline replays after a colleague changed that grade; how should the server reject it, and what should the teacher see?
basics
~20 sThe queued grade carries the revision the teacher saw; the server refuses it once the record has moved on, returning the current value. The app parks that entry and shows both versions: keep theirs, apply mine, or edit.
In an online auction web app, what transport should the bid ladder, watchlist, watch count, bidding and announcements use, and should they share one connection?
basics
~20 sEverything the server pushes - ladder, watchlist prices, watch count, alerts, announcements - shares one live connection per tab, subscribed by topic. Placing a bid stays an HTTP POST with an idempotency key, because it needs a definitive answer.
On an online auction's lot page, the live connection drops for twenty seconds near closing; how should the browser client detect it, reconnect, resubscribe and catch up, and what should the bidder see meanwhile?
basics
~20 sTreat missed heartbeats as a dead connection and label the price stale. Reconnect with capped, jittered backoff, resubscribe only the lots on screen, read each lot's current state with its sequence number, then apply buffered events newer than it.
When bids on an online auction's lot page burst to dozens a second, how should the page paint the ladder, price and watch count?
basics
~20 sFold events into pending state where the latest value per field wins and the ladder keeps its top entries, then paint once per animation frame. Show watchers as a throttled, rounded number; announce only what the bidder must act on.
On an online auction's lot page, bid events arrive duplicated, out of order or with a sequence number missing; how should the browser client handle each case?
basics
~20 sTrack the last applied sequence per lot: drop events at or below it, apply the next one and drain held successors, hold later ones briefly, and if the gap persists, resync from a state read.
For a team wiki's page editor where up to thirty people edit at once and some work offline on trains for an hour, would you merge edits with OT or a sequence CRDT?
basics
~20 sA sequence CRDT: hour-long offline edits merge without a central server transforming every operation, at the cost of per-character metadata the page must load, so snapshot it. Always-online editing would make OT the lighter choice. Whiteboard objects need only per-property merge.
In a team wiki's collaborative page editor, how would you show each collaborator's cursor and selection so they stay on the right characters while others type?
basics
~20 sTreat cursors as ephemeral presence, not edits: send selections as anchors tied to characters (transformed offsets in OT, character identities in a CRDT), re-resolve them after every edit, throttle sends, and draw named carets that fade when idle.
A team wiki editor merges an hour of offline train edits cleanly, but two people rewrote the same paragraph; what should the page show them, and how does it know?
basics
~20 sConverged is not correct: the paragraph now holds both rewrites. After syncing, find blocks where your offline edits and others' concurrent edits overlap, mark them in place with who else edited, and offer both versions to compare, without blocking editing.
A two-year-old team wiki page opens slowly because the browser replays its whole operation log; how would snapshots fix that, and what happens to a laptop offline longer than the log is kept?
basics
~20 sOpen from a recent snapshot plus only the operations after it, cache that snapshot locally, and compact the log on a schedule. A laptop whose base predates the kept log cannot merge automatically: keep its edits and offer a guided reapply.
In a team wiki's collaborative editor, how should undo revert only your own changes when a colleague has since edited the same paragraph?
basics
~20 sKeep an undo stack of only your own operations; undo builds the inverse of your latest group, adjusted for every edit applied since, and sends it as a new operation, so colleagues' later work survives and nobody's document rewinds.
When designing an online store's frontend, which rendering mode would you give the home, category, product, search, cart, checkout and order-history pages, and why?
basics
~20 sAssign a mode per page type from four inputs: freshness, personalisation, indexing and latency. Home, category and product pages get prerendered HTML regenerated on change; search renders per request; cart, checkout and order history render in the browser.
Why might an online store's client-rendered product pages reach one search engine's index late and another's not at all, and what would you change?
basics
~20 sThe first response is an empty shell, so content appears only after the crawler's deferred render succeeds, and crawlers that run no script never see it. Server-render or prerender the indexable page types; keep client rendering for personal ones.
When designing an online store's frontend, which page types would you ship as server HTML with a few hydrated islands, and which need the whole page hydrated or client-rendered?
basics
~20 sMostly static pages with local interactivity, such as product detail and help articles, become server HTML with islands, cutting their script. Checkout and the seller dashboard, one interactive surface with shared state, keep full hydration or client rendering.
An online store prerenders its catalogue and help pages but client-renders cart, checkout and order history; what seams does that mix create, and how would you design them?
basics
~10 sMixing modes creates seams: shopper data on shared pages, navigation between render paths, status codes from a client-rendered area, protection of account data, and builds of different ages. Each seam needs an explicit design.
An online store's product page moved from client rendering to per-request server rendering: LCP fell from 3.8 s to 2.3 s, but TTFB rose from 0.2 s to 1.1 s. Is that a good trade, and what next?
basics
~20 sMostly yes: LCP is what shoppers feel and TTFB is not a Core Web Vital, but 1.1 s leaves little margin under the 2.5 s LCP target. Shared product HTML should be prerendered and regenerated to win both.
In a community-board web app's infinite home feed, how would you design loading older posts, and what should happen when new posts arrive meanwhile?
basics
~20 sFetch older posts a screen or two before the end, one request at a time, with the server's cursor; drop repeated ids; show retry and end rows; and announce new posts with a banner, never inserting them above the reader.
For a community-board web app's mixed home feed on phones, would you window it, use content-visibility, or plain pages, and at what cost?
basics
~20 sStart with appended pages and content-visibility: auto, which skips rendering off-screen posts yet keeps them findable and readable by screen readers; it does not cap memory, so past a measured ceiling, window or drop far pages.
When a community-board web app's feed has loaded several hundred posts on a phone, why is keeping every post in the page a problem?
basics
~20 sEvery loaded post stays as DOM nodes, media and listeners, so memory keeps growing and each update or tap makes the browser restyle and lay out a bigger tree; on a phone that means late taps and janky scrolling.
In a community-board web app, a reader opens a post two hundred items down and presses Back; how do you return them to the same place?
basics
~20 sIf the post is a separate document, keep the feed eligible for the back/forward cache, which restores it whole. Otherwise the app restores itself from saved post ids, cursor, heights and an anchor post with its offset, then refreshes counts.
In a community-board web app's windowed feed on phones, how would you keep the reader's place steady when heights change — a photo above loading, a post edited or deleted?
basics
~20 sReserve space so most heights never change: media boxes sized from API dimensions, fixed-width counts. Otherwise estimate per post type, measure once rendered, and when a post above the viewport changes height, shift the scroll by the difference.
In a music-streaming web app's search dropdown, where should focus stay as users arrow through suggestions, and how do screen readers learn the active one?
basics
~20 sDOM focus stays in the text input; the input's aria-activedescendant names the id of the active option, so screen readers announce it while typing, the caret and the phone keyboard keep working. Keep option ids stable across refreshes.
For a music-streaming web app's search box on mobile networks, how would you budget delay, minimum length and round trip, and which response may paint?
basics
~20 sBudget pause-to-paint as delay plus round trip plus server plus render, keeping the short delay as the only pure wait. Warm the connection, keep responses small, skip the delay on cache hits, and paint only the response for the current text.
In a music-streaming web app's search box, why shouldn't it request suggestions on every keystroke, and what should it wait for instead?
basics
~20 sMost per-keystroke requests ask about text the user has already typed past: they waste data and battery, flicker unreadable results and delay the answer that matters. Wait for a short pause and a useful minimum length; show local matches at once.
For a music-streaming web app's search box, what should a tab's prefix cache hold, how long, and when can shorter prefixes answer longer ones?
basics
~20 sKeep normalised queries, results and a completeness flag in memory for a few minutes, keyed also by account, market and content setting. A shorter prefix may answer a longer one only when its list was complete and matching is plain prefix.
In a music-streaming web app's search box, recent searches and library matches paint instantly but remote suggestions land later; how do you merge them without reshuffling under the arrow key, and what should a screen reader hear?
basics
~20 sFix the layout: local sections on top, remote groups below in reserved space, duplicates removed by catalogue id. Network arrival never moves rows at or above the active one. A polite status region announces one short count when the list settles.
In a real-estate listing portal's web uploader handling 60 photos and a 3 GB video, how should per-file progress, total progress, retry and cancel work?
basics
~20 sTrack each file's state and bytes; total progress is confirmed plus in-flight bytes over all bytes. Retry transient failures with backoff, stop a file on permanent ones, and cancel by aborting only that file's requests.
When an agent's 3 GB walkthrough upload in a real-estate listing portal stops at 1.8 GB after a dropped uplink, an expired URL or a reload, how does the page resume?
basics
~20 sAsk the server how many bytes it holds and send the rest from that offset with Blob.slice. Surviving a reload also needs the saved upload id and file fingerprint, a fresh URL, and the agent choosing the file again.
In a real-estate listing portal's web uploader, what steps does the page take to send one photo straight to storage with a pre-signed URL?
basics
~20 sThe page asks the portal's API for an upload id and a short-lived pre-signed URL, sends the photo's bytes straight to that URL, then tells the API the upload finished so the server can verify and attach it.
In a real-estate listing portal's web uploader, which checks and previews should run before any byte is sent, and what do they cost the page?
basics
~20 sCheck count, size, type and, for photos, decoded dimensions before sending, to spare the agent's uplink, as feedback only because the server checks again. Preview with object URLs or small thumbnails, and revoke each URL when its tile goes.
In a real-estate listing portal's web uploader sending 60 photos and a 3 GB video over a phone's weak uplink, how many uploads should run at once, and why?
basics
~20 sRun a small overall cap, about two requests on a weak phone uplink and three or four on office broadband, with the video in one lane and photos in the rest. More parallel requests split a thin uplink without adding bandwidth.
For an online tax-filing web app, which failures must the page capture globally, and how do reports reach one pipeline before the tab closes?
basics
~20 sCapture uncaught errors, unhandled promise rejections, errors that render boundaries catch and forward, and failed script or chunk loads; turn each into one report envelope in one in-memory queue, and flush it in small batches when the page becomes hidden.
A tax-filing web app's forms hold income figures and national ID numbers; what must its error reports strip in the browser, and how do breadcrumbs and consent fit?
basics
~20 sBuild reports from an allow-list in the browser: route templates instead of URLs, no form values or request bodies, breadcrumbs that name elements but never values, digits masked in messages, and nothing sent until the user's diagnostics choice allows it.
A tax-filing web app loads its bundles from a separate static domain, and every error report reads only 'Script error.'; why, and what must change?
basics
~20 sThe bundles are cross-origin scripts fetched without CORS, so the browser mutes their errors to 'Script error.' with no file, line or error object. Add crossorigin="anonymous" to every script tag and have the static domain send Access-Control-Allow-Origin.
A tax-filing web app ships weekly; how would you keep its source maps private yet map every report to the right build, and group reports into issues that survive a release?
basics
~20 sBake a release id into each build and stamp it on every report; upload that build's maps privately, keyed by release, before the deploy goes live. Group by error type, normalised message and top symbolicated in-app frames.
In deadline week, a tax-filing web app gets ten times its usual traffic and one bug fires in a loop; how would you sample and cap its error reports?
basics
~20 sDecide sampling once per session and put the rate on every report; cap each error group per page and send a count of the repeats; keep submit-step errors at full rate; and let the server change the rate without a release.