Recommended preparation

A - Architecture Deep Dive for Frontend System Design Interviews

18 minsystem designarchitectureradio framework

Use this architecture guide to choose client-side boundaries, rendering strategy, BFF trade-offs, cache layers, and an interview-ready frontend architecture diagram.

Menu
On this page

If You Remember One Thing

In a system design interview, Architecture is not about drawing more boxes. It is about proving that each boundary, rendering choice, and data path follows from Requirements. In the RADIO framework, this is where your frontend system design answer becomes defensible, measurable, and production-aware.

Scope Guard: What This Page Covers

This page is intentionally focused on system boundaries and rendering strategy: browser/edge/BFF/API boundaries, per-route rendering mode, and resilience guardrails. Treat it as a frontend client side architecture interview guide, not a backend topology tour.

Client-side architecture layers

A strong frontend architecture answer separates client-side responsibilities before it talks about services. This keeps the interview grounded in UI delivery, route ownership, cache behavior, and production signals.

LayerOwnsInterview signal
View layerPage shell, reusable components, composition boundariesYou can keep UI responsibility clear without over-splitting components.
Routing and renderingRoute ownership, CSR vs SSR vs SSG choice, hydration handoffYou choose a frontend rendering strategy system design by route, not by preference.
Data access / BFF boundaryAPI client, auth/session shaping, aggregation, response normalizationYou avoid leaking orchestration and trust decisions into components.
Server-state cacheQuery keys, freshness, dedupe, refetch, invalidation triggersYou control consistency, stale behavior, and race risk.
UI stateModals, selected rows, focused item, drafts, optimistic flagsYou keep local interaction state separate from server truth.
TelemetryWeb vitals, client errors, API timeout, task completionYou can prove architecture risk is measurable after launch.

What Architecture Must Produce

Your architecture section should end with concrete artifacts, not vague claims.

ArtifactMinimum interview barWhy interviewer cares
High-level architecture diagramBrowser, CDN/edge, BFF/API, data services, observability hooksTests structure and boundary clarity
Route-by-route rendering matrixWhich routes are CSR/SSR/SSG/edge and whyTests if trade-offs are context-driven
Data flow and state boundariesServer truth vs client-derived state and sync pointsTests consistency and failure thinking
Caching and invalidation planHTTP, CDN, app cache, and invalidation triggersTests scale and reliability readiness
Risk and fallback notesKnown bottlenecks + mitigation pathTests senior-level production judgment

What to draw in the architecture diagram

The goal is an interview-ready frontend architecture diagram: enough boxes to explain boundaries, not enough to disappear into backend internals.

Diagram elementIncludeWhy it matters
Browser and app shellShell, route container, feature modules, hydration boundaryShows where interactive frontend work begins.
Route / rendering boundaryCSR, SSR, SSG, or edge rendering per key routeMakes route by route rendering strategy explicit.
State and cache layersServer-state cache, URL state, UI state, persistence if neededPrevents server truth and local interaction state from blending together.
API / BFF boundaryAPI client, BFF, downstream APIs, auth/session checksShows where aggregation, trust, and response shaping live.
Failure and observability hooksTimeouts, partial response path, error reporting, web-vitals captureProves the architecture has fallback and measurement paths.

Inputs You Must Pull from Requirements

Architecture quality depends on what you carried from Requirements. This is why system design interview preparation should include a Requirements gate.

Requirement inputArchitecture decision it drivesWhat to say out loud
SEO-critical entry pagesSSR/SSG on public routes, CSR for post-login flows"I will split rendering by route to protect crawlability and interaction speed."
High burst trafficCDN caching, edge compute for read-heavy endpoints"I am pushing cacheable work to edge/CDN to flatten origin load."
Strict interaction latencyBFF aggregation + request dedupe + streaming/skeleton strategy"I will optimize the request path for p95 interaction, not just average latency."
A11y baseline and global audienceArchitecture supports focus management, i18n bundles, graceful degradation"Accessibility and localization are first-class architecture constraints, not polish."
Team ownership constraintsModular monolith or microfrontend boundary by domain"I am choosing boundaries by ownership and deploy risk, not trend."

Architecture Options Matrix

OptionWhen it winsTrade-offsFailure mode to watch
CSR-heavy SPAAuth-gated tools, frequent interaction, low SEO pressureGreat DX and velocity; weaker first paint on slow devicesLarge bundles hurt Time to Interactive
SSR by defaultPublic content with SEO + faster first contentful renderHigher server cost and cache complexityOrigin saturation during traffic spikes
SSG/ISR for stable contentDocs, marketing, category pages with predictable updatesBuild/revalidation complexity for freshnessStale pages if invalidation is weak
Hybrid per-route (recommended default)Mixed app: SEO entry + rich dashboard interactionsMore moving pieces but best fit-to-routeInconsistent rules across teams/routes
Edge rendering and BFFGlobal latency sensitivity + multi-API aggregation needsOperational complexity and observability depth neededHard-to-debug edge/runtime mismatches

When BFF and edge belong in the answer

A frontend system design BFF is useful only when it changes the frontend architecture, latency path, or trust boundary. Name it deliberately and explain what moves out of the client.

Use BFF / edge whenSkip it whenTrade-off to say out loud
Multiple APIs must be aggregated for one screenThe page calls one stable endpoint directly"This reduces client orchestration but adds an operational hop."
Auth/session shaping or permissions affect response shapeThe client can safely receive the same public payload"I am centralizing trust decisions outside reusable UI code."
Global latency or cacheable personalization mattersThe route is auth-heavy and not cacheable"Edge helps the read path, but observability and runtime limits get harder."
Partial response semantics improve the user experienceAll dependencies must succeed or the flow cannot continue"I will return usable partial data with explicit degraded UI state."

Baseline Reference Architecture

Use this as your default starting point

User Browser
  -> CDN/Edge (cache, WAF, bot/rate controls)
  -> App Renderer (SSR for entry routes, CSR hydration for interactive routes)
  -> BFF (auth checks, API aggregation, response shaping)
  -> Domain APIs (search, profile, catalog, recommendations)
  -> Data stores / cache layers

Client side:
  Router + feature modules + server-state cache + UI-state store + telemetry SDK
  • Boundary 1: keep auth/session logic outside raw UI components.
  • Boundary 2: centralize cross-domain aggregation in BFF, not in components.
  • Boundary 3: separate server state cache from local UI state.

Route-by-route rendering strategy

Route typeRendering modeCache strategyReasoning
Home / landing / SEO pagesSSR or SSG + hydrationCDN cache with short revalidationProtect discoverability and first content speed
Search results shellSSR shell + CSR updatesCDN for shell, client cache for queriesFast first paint + responsive filtering
Dashboard / accountCSRClient cache + API cache headersHigh interactivity, low SEO need
High-read static docsSSG/ISRLong CDN TTL + controlled invalidationCheap and globally fast delivery

Data Flow, State Boundaries, and Caching

Server truth vs client-derived state

State categoryOwnerExample
Server truthAPIs + server-state cacheProduct entities, permissions, pricing
Client view stateUI store/component stateSelected tab, modal open, sort toggle
URL stateRouterSearch query, filters, pagination

Cache hierarchy and invalidation rules

  • CDN cache: cache public GET responses with explicit TTL and revalidation tags.
  • BFF cache: short-lived aggregation cache for hot endpoints.
  • Client server-state cache: dedupe requests, background refresh, stale-while-revalidate UX.
  • Invalidation triggers: write mutation, permission change, deploy with schema change, manual admin purge.

Failure Modes and Resilience Design

FailureUser-facing behaviorArchitecture guardrail
Slow upstream APISkeleton + partial data + stale bannerTimeout budgets + fallback response path
One dependency fails in aggregated responsePartial render with explicit degraded stateBFF partial response contract
Burst traffic eventGraceful latency increase, no white screenCDN offload + rate limiting + circuit breaker
Auth refresh failureSoft logout + preserved intent for retryCentralized session refresh policy

Performance and Cost Trade-offs

  • Set a performance budget before optimizations (for example, p95 interaction under 150ms).
  • Prioritize two biggest wins: request path reduction and JS bundle pressure.
  • Call cost trade-off explicitly: aggressive SSR improves first paint but increases origin spend.
  • Use progressive enhancement so low-end devices still complete core tasks reliably.

Security and Trust Boundaries

  • Keep tokens out of fragile client storage patterns; use secure session strategy aligned with platform.
  • Define trust boundaries at CDN, BFF, and API edges.
  • Mitigate XSS/CSRF with CSP, strict output encoding, and anti-CSRF controls where needed.
  • Treat rate-limiting and abuse detection as architecture components, not afterthoughts.

Observability Plan

SignalMetricAlert direction
Frontend responsivenessp95 interaction latency by routeAlert if sustained over budget for 15m
ReliabilityClient-visible error rate for core flowAlert on threshold and region skew
API healthBFF upstream timeout and partial-response rateAlert on sudden slope changes
User outcomeTask completion rate for primary flowAlert on statistically significant drop

Prompt-specific architecture decisions

Use prompt families to show that your frontend system design tradeoffs are contextual, not memorized.

PromptArchitecture decisions to surfaceRisk to call out
Autocomplete / realtime searchSSR shell + CSR updates, debounced request path, query-keyed cache, BFF for ranking/personalization if neededStale response races and p95 suggestion latency
News feedCursor pagination, virtualized timeline, media prefetch, freshness policy, route-level cache strategyDuplicate items, stale feed, and heavy media on low-end devices
Dashboard widgetsCSR dashboard, widget isolation, layout persistence, refresh schedule, permission-aware data fetchOne slow widget blocking the whole screen
AI chatStreaming path, draft persistence, message ordering, reconnect behavior, optimistic/error statesInterrupted streams and duplicated messages after retry
Design system architecturePackage boundaries, token pipeline, component API contracts, documentation/versioning, adoption telemetryBreaking changes across teams and inconsistent token usage

What to Say Out Loud (Architecture Script Cues)

  1. "I will map architecture decisions directly to the requirements we already locked."
  2. "I am choosing rendering per route, not globally, because route goals differ."
  3. "I will use BFF to reduce client orchestration and keep domain contracts stable."
  4. "I am separating server truth from view state to prevent sync bugs."
  5. "I will make failure behavior explicit: empty, error, stale, and partial states."
  6. "Trade-off here: this improves first paint but increases server cost and cache complexity."
  7. "I will define invalidation triggers now so stale behavior is predictable."
  8. "I am adding observability hooks so architecture risk is measurable after launch."
  9. "Given time, I will prioritize the highest-traffic path before secondary flows."
  10. "I have a clear default now; next I will detail the data model and contracts."

Architecture Timebox for Interviews

45-minute interview

Time rangeWhat to doOutput artifact
0:00-2:00Confirm requirement inputs that drive architectureDecision driver list
2:00-5:00Draw high-level architecture and trust boundariesSystem diagram
5:00-7:00Define route rendering strategyRoute-by-route matrix
7:00-9:00State/caching/failure model summaryRisk + fallback notes

60-minute interview

Time rangeWhat to doOutput artifact
0:00-3:00Confirm requirement drivers and trade-off prioritiesPrioritized constraints list
3:00-7:00Draw architecture and call out boundariesFull architecture diagram
7:00-10:00Route rendering + caching layersRendering and cache matrix
10:00-12:00Resilience, observability, security recapHardening checklist

Quick Drill: Typeahead Search Architecture in 7 Minutes

  • Minute 0-1: Declare route strategy: SSR shell for first load, CSR for keystroke updates.
  • Minute 1-2: Draw request path: Browser -> CDN -> BFF -> Search API.
  • Minute 2-3: State split: server suggestions cache vs UI focus/index state.
  • Minute 3-4: Add cache rules: query-keyed client cache + short CDN TTL for popular prefixes.
  • Minute 4-5: Failure behavior: timeout fallback, empty state, partial stale display.
  • Minute 5-6: Add observability: p95 suggestion latency, error rate, zero-result rate.
  • Minute 6-7: State trade-off: simpler now with upgrade path for ranking/personalization later.

Before You Move to Data Model

  • You chose rendering mode by route and explained why.
  • Boundaries between browser, edge, BFF, and APIs are explicit.
  • Server truth, UI state, and URL state ownership is clear.
  • Cache layers and invalidation triggers are concrete.
  • Failure, observability, security, and cost trade-offs are acknowledged.

Architecture FAQ

What is frontend system design architecture?

Frontend system design architecture is the interview step where you choose client-side boundaries, rendering strategy, data flow, cache layers, BFF or API boundaries, and resilience guardrails that satisfy the requirements.

How do I choose CSR, SSR, SSG, or edge rendering?

Choose rendering per route. Use SSR or SSG for SEO and fast public entry routes, CSR for highly interactive authenticated tools, and edge rendering when global latency or cacheable personalization changes the user experience.

What should I draw in a frontend architecture interview?

Draw the browser, app shell, router and rendering boundary, server-state cache, UI state, API or BFF boundary, downstream services, failure paths, and observability hooks.

When should I use a BFF in frontend system design?

Use a BFF when it reduces client orchestration, aggregates multiple APIs, shapes auth/session-aware responses, enables partial responses, or gives a cleaner caching and latency boundary. Skip it when it is backend topology noise.

How is frontend architecture different from data model or interface design?

Architecture chooses system boundaries, rendering modes, data flow, cache layers, and resilience paths. Data model details entities and ownership, while interface design details components, interactions, accessibility, and UI states.

Next