Skip to main content

React system design and trade-off drills

System-design interviews test whether you can choose boundaries under constraints and explain the consequencesβ€”not whether you can draw the most boxes.

Reusable design method​

1Requirements
2Constraints
3Ownership
4Data flow + rendering
5Loading/failure
6Performance/security/a11y
7Testing/observability/trade-offs

Search experience​

For 100,000 products, clarify server/client search, latency, typo tolerance, URL/shareability, filters/sort, device constraints, and SEO/rendering requirements.

A scalable search path keeps ownership explicit
URL query/filter state
shareable navigation truth
Search/data layer
debounce/cancel/stale protection
Result boundary
Suspense/navigation/rendering

useDeferredValue may improve expensive result rendering; it does not reduce network requests.

Infinite live activity feed​

How should live + historical feed data scale?
Historical pages/cursorsServer-state pagination/cache
High-frequency live eventsNormalized external/live store with narrow subscriptions
Thousands of rendered itemsWindowing/virtualization
Optimistic reactionsTemporary projection + canonical reconciliation

Bound in-memory retention and design event ordering/reconnect semantics explicitly.

Collaborative editor​

React is one layer in collaborative consistency
Document model
durable remote truth / CRDT/OT/backend model
Presence
high-frequency external state
Local interaction
selection Β· cursor Β· temporary UI
Optimistic edits
pending projection
Version/conflict
reconciliation policy
React UI
selective rendering/subscription

Do not try to solve distributed consistency with React state alone.

Large admin table​

Use server pagination/filtering for scale, URL state for shareable filters, stable IDs, feature-owned selection, virtualization when measured, optimistic edits with server validation, and accessible table/grid semantics appropriate to the interaction model.

What is the table bottleneck?
Data volume/request costServer paging/filtering
DOM node volume/scrollingVirtualization/windowing
One row update rerenders everythingNarrow ownership/subscriptions/component boundaries
Browser layout dominatesFix DOM/CSS layout rather than React memoization

Multi-step onboarding​

1Route/step identity
2Form draft
3Server-persisted progress
4Runtime validation
5Accessible navigation/errors
6Resume/idempotent save

Avoid mounting one giant form forever merely because the workflow is multi-step.

Notification system​

Durable notifications and transient toast UI are different state categories
Server notifications + live/cross-tab channels
durable records/events
Data/external store
unread state + records
Notification center
durable UI view
Toast
temporary feedback

Design system for many teams​

Discuss semantic/accessibility contracts, primitives vs product components, tokens, refs, controlled/uncontrolled APIs, compound/headless patterns, versioning, contract tests, documentation, migration tooling, and ownership.

Should a shared primitive expose maximum polymorphism?
Product genuinely needs multiple semantic hostsMaybe, with tested type/a11y constraints
Flexibility mainly creates invalid combinationsPrefer explicit semantic variants
Need is product-specificKeep it in the feature wrapper

Analytics dashboard​

Split server-friendly shell/data from expensive client visualization
Server-rendered shell
initial context + read-only summary
Filters
client interaction
Summary metrics
server/streamed
Charts
lazy client islands + accessible data alternative

Discuss chart bundle cost, Suspense reveal, filter ownership, cache freshness, expensive rendering, and non-visual alternatives for chart information.

Chat application​

Separate durable message history, ephemeral typing/presence, optimistic pending sends, connection state, and pagination history. High-frequency presence should not automatically broadcast through broad Context.

Feature-flagged migration to RSC​

1Measure current bottleneck
2Pick low-risk route
3Establish server infrastructure
4Keep interactive client islands
5Move beneficial server reads
6Canary + compare telemetry
7Expand only with evidence

Do not migrate because a technology is newer.

Common trade-off drills​

Context or external store?
Tree-scoped, manageable frequency, broad consumersContext may fit
Independent/high-frequency state with selective consumersExternal store may fit
Local state or URL?
Temporary UI intent with no navigation semanticsLocal state
Shareable/bookmarkable/back-forward stateURL
Optimistic or confirmed mutation UX?
Low-risk reversible actionOptimistic may improve UX
High-impact/destructive/money/permission actionPrefer stronger confirmation semantics

What the interviewer is evaluating​

Ownership
one source of truth per concern
Boundaries
execution Β· async Β· failure Β· trust
Scale
data Β· DOM Β· subscriptions Β· bundles
Correctness
authorization Β· races Β· conflicts
Experience
loading Β· accessibility Β· responsiveness
Operations
tests Β· telemetry Β· rollout Β· reversibility

A strong system-design answer makes alternatives explicit and explains why the chosen boundary is appropriate for the stated constraints.