Frontend System Design Interview: A Framework and Example
How to approach a frontend system design interview: requirements, component architecture, data model, API interface and optimisations, with a worked example.
A frontend system design interview asks you to design the client side of a product: a news feed, an autocomplete, a chat app, a photo gallery, a collaborative editor. Instead of databases and load balancers, you're judged on component architecture, data and state, the API contract you need, rendering and network performance, offline and error behaviour, and accessibility. A simple, repeatable structure keeps a 45-minute round on track.
A framework for the round
| Step | Time | What to cover |
|---|---|---|
| 1. Requirements | 5 min | Core features, users and devices, scale of data on screen, offline needs, accessibility and internationalisation |
| 2. Architecture | 10 min | Main components and how data flows between them, client-side layers (view, state, data layer, network) |
| 3. Data model | 5 min | The client-side shape of entities and state: what's server data, what's UI state, how it's normalised |
| 4. API interface | 5 min | Endpoints or messages you need, pagination, real-time channel, payloads |
| 5. Optimisations and deep dives | 15 min | Performance, network efficiency, rendering, offline, error states, security, accessibility |
| 6. Wrap-up | 5 min | Trade-offs, what you'd measure, what you'd do next |
Worked example: a news feed
Requirements
Users scroll an infinite feed of posts with text, images and video; they can like and comment; new posts appear without a full reload; it must work on slow mobile networks and be usable with a screen reader. Out of scope: composing posts, ads.
Architecture
Data model and API
- Normalise posts and users by ID in a client cache, and store the feed as an ordered list of post IDs plus a cursor, so a like updates one place and every view of that post re-renders. See state management.
GET /feed?cursor=…&limit=20returns posts, embedded authors and the next cursor. See pagination.- A server-sent events or WebSocket channel announces new posts; the client shows a "new posts" pill rather than shifting content under the user's finger. See real-time communication.
POST /posts/{id}/likewith an idempotency key, applied optimistically.
Optimisations to discuss
- Virtualize the list so only visible posts are in the DOM; prefetch the next page before the user reaches the end.
- Responsive, lazy-loaded images with fixed aspect ratios to avoid layout shift; play videos only when visible.
- Server-render or statically render the shell for a fast first paint, then hydrate. See rendering strategies.
- Optimistic likes with rollback on failure; a retry queue when offline.
- Skeleton states, error states with retry, and an empty state.
- Accessibility: semantic article elements, keyboard navigation, focus management when new content loads, alt text.
What interviewers look for
- Clear separation of server state, client state and UI.
- Network awareness: pagination, caching, deduplicated requests, cancellation of stale requests, behaviour on slow or flaky networks.
- Performance with measurement: naming Core Web Vitals and how each choice affects them.
- Robustness: loading, error, empty and offline states, not just the happy path.
- Accessibility and internationalisation as requirements, not afterthoughts.
- Trade-offs stated out loud, for example SSR's faster first paint vs its server cost.
Interviewers often probe one area deeply. Have a ready deep dive for infinite scroll, image loading, offline sync and real-time updates, since they come up again and again.
Where it’s used
Virtualised lists, cursor pagination and optimistic interactions.
Debounced input, request cancellation, cached results and keyboard-accessible suggestions.
Real-time channels, message ordering, offline outbox and presence.
In an interview
- Follow requirements, architecture, data model, API, then deep dives.
- Normalise server data in a client cache and keep UI state separate.
- Design the API you need, including pagination and real-time updates.
- Cover loading, error, offline and accessibility states.
Further reading
- web.dev: Learn PerformanceGoogle Chrome team
- WAI-ARIA Authoring Practices GuideW3C Web Accessibility Initiative