Frontend System Design Framework

A 6-step framework for frontend system design interviews โ€” requirements, architecture, component tree, data flow, performance, and trade-offs.

must medium โฑ 22 min frontend-system-designframeworkarchitecturerequirementstrade-offs
Mastery:
Why interviewers ask this
Senior frontend interviews always include a system design round. Interviewers expect a structured approach, not just listing technologies.

Frontend system design asks you to design the client-side architecture of a product โ€” how the UI is structured, how data flows, how components communicate, and how performance and accessibility are maintained at scale.

The 6-step framework

Step 1: Clarify requirements (5 min)

Always start with questions. Points to clarify:

Functional: What must it do?

  • Core user journeys (list them explicitly)
  • Key interactions (search, real-time, offline?)
  • Data shape (static? paginated? streaming?)

Non-functional: What constraints matter?

  • Scale: MAU, data volume, expected concurrency
  • Performance targets: LCP < 2.5s? 60fps scrolling?
  • Accessibility: WCAG level?
  • Platforms: web, mobile web, native app?
  • Auth: who sees what?

Out of scope: What will you NOT cover?

  • State: โ€œIโ€™ll skip auth implementation, focus on the feedโ€

Step 2: High-level architecture

Draw the system boundary โ€” what clients exist, what APIs they hit:

Browser                 CDN               Server
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  React App (SPA)โ”‚โ”€โ”€โ”€โ–ถโ”‚ CDN โ”‚    โ”‚  REST / GraphQL  โ”‚
โ”‚  - Next.js (SSR)โ”‚    โ”‚     โ”‚    โ”‚  API Gateway     โ”‚
โ”‚  - React Native โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚  WebSocket (RT)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Choose rendering strategy:

StrategyWhen to use
CSR (SPA)Dashboard, auth-gated, highly interactive
SSRSEO-critical, content-heavy, first-load perf critical
SSGBlog, docs, product pages โ€” content doesnโ€™t change per user
ISRSSG with periodic revalidation (Next.js)

Step 3: Component architecture

Break the UI into a hierarchy:

<App>
  <Header>                 โ† global, nav
  <FeedPage>
    <FeedSidebar>
    <FeedList>             โ† virtualized
      <PostCard> ร— N
        <PostMedia>
        <PostActions>
    <InfiniteLoadTrigger>
  </FeedPage>
</App>

Identify which components are:

  • Containers: fetch data, manage state, pass down via props
  • Presentational: receive props, render only
  • Shared: design system components (Button, Avatar, Modal)

Step 4: Data & state management

Categorize state:

  • Server state: data from the API โ€” use TanStack Query / SWR
  • UI state: open/closed, selected tab โ€” component-local useState
  • Global client state: theme, auth, user preferences โ€” Zustand / Context
  • URL state: pagination cursor, filters โ€” query params (shareable, bookmarkable)

Define the data model for the main entity:

interface Post {
  id: string;
  author: { id: string; name: string; avatarUrl: string };
  content: string;
  mediaUrls: string[];
  likeCount: number;
  commentCount: number;
  createdAt: string;
  viewerHasLiked: boolean;
}

Define API contract:

GET /api/feed?cursor=xxx&limit=20
โ†’ { items: Post[], nextCursor: string | null }

POST /api/posts/:id/like
โ†’ { likeCount: number, viewerHasLiked: boolean }

Step 5: Performance & optimization

For every system, address:

Initial load:

  • Code splitting per route (React.lazy, Next.js dynamic imports)
  • Critical CSS inlining; defer non-critical JS
  • Image optimization: WebP, correct sizes, lazy loading, srcset
  • Preconnect to API origin

Runtime:

  • Virtualize long lists (FlatList / react-window)
  • Memoize expensive derived data (useMemo, createSelector)
  • Debounce inputs, throttle scroll handlers
  • Optimistic updates for mutations (perceived performance)
  • Prefetch next page when user is 80% through current page

Bundle:

  • Tree shaking via ESM
  • Analyze with Webpack Bundle Analyzer / Rollup Visualizer
  • Load heavy libraries asynchronously

Real-time:

  • WebSocket for live updates (chat, notifications, live feeds)
  • Server-Sent Events (SSE) for one-way streams (dashboards)
  • Polling as fallback (every 30s for less-critical updates)

Step 6: Accessibility, error states, and edge cases

Always mention:

  • Keyboard navigation: focus management, ARIA roles
  • Screen readers: semantic HTML, aria-label, live regions
  • Error states: empty state, network error, partial failure
  • Loading states: skeleton screens vs spinners (skeleton for layout-heavy)
  • Offline: offline banner, cached data, queue mutations
  • Responsive: mobile-first, touch targets โ‰ฅ 44px

Evaluation rubric

AreaWhat interviewers assess
RequirementsDid you ask the right questions before designing?
ArchitectureAppropriate rendering strategy, clean separation of concerns
Data flowState management choice fits the problem
PerformanceList virtualization, code splitting, caching mentioned
AccessibilityAt least role/ARIA basics, keyboard nav
DepthDid you pick one area to go deep on?
Trade-offsCan you defend your choices against alternatives?

The senior signal
Interviewers give credit for stating trade-offs, not for having all the right answers. โ€œI chose cursor pagination over offset because offset has duplicates on live feeds โ€” the trade-off is slightly more complex client codeโ€ scores higher than โ€œIโ€™d use paginationโ€ with no justification.

Likely follow-up questions
  • What is the difference between frontend system design and backend system design?
  • How do you decide between SSR and CSR for a given problem?
  • How do you design for mobile vs desktop?
  • How do you handle real-time updates in a frontend system?

References