Frontend system design
Design a photo feed / chat / autocomplete: component tree, state shape, API contract, virtualization, optimistic updates, offline. The senior frontend round.
The mental model
Frontend system design is answering, for a real product surface — a feed, a chat, an autocomplete, a spreadsheet — the same four questions every time: what is the component tree, where does each piece of state live, what is the contract with the server, and how does it hold up at scale (many items, slow network, offline, concurrent edits). The senior frontend interview is whether you can drive those four to a coherent design out loud, making tradeoffs explicit.
The analogy: designing a restaurant, not cooking one dish. A backend system-design interview is the kitchen and supply chain — throughput, sharding, consistency. The frontend one is the dining room: how the menu is laid out (component tree), who holds the orders and where (state), how waiters talk to the kitchen (API contract), and what happens when 300 people show up at once or the kitchen is slow (virtualization, optimistic updates, offline). Same restaurant, a different half of it, and the frontend half has its own hard problems that "just use React" does not answer.
Why this exists — what breaks without it. A frontend that grows without a design becomes a swamp: state duplicated in five components that drift out of sync, every keystroke re-rendering the world, a feed that janks at 2,000 items, likes that feel broken because they wait 300ms for the server, and a data layer that races itself into showing stale results. These are not bugs you fix one at a time — they are the *absence of a design*. The interview probes for the design because the alternative is a codebase that works in the demo and collapses in production. The single most important question, the one every other decision hangs off, is "where does this state live?" — get that wrong and no amount of memoization saves you.
The organising principle: classify state before you place it. Server state (data owned by the backend, cached on the client), client state (UI that is purely local), and URL state (things that must survive a refresh or a shared link) have different homes and different tools, and mixing them up is the root of most frontend architecture pain.
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision