Frontend Component and State Architecture Questions

Structuring client applications for maintainability: component architecture and code organization (composition and compound components, container/presentational split, controlled vs uncontrolled components, prop drilling and context, refs and imperative handles, folder and module boundaries as a codebase grows), state management and data flow (local vs global state, state colocation and lifting, reducers and stores, selectors and derived state, normalization, immutability, one-way flow, migrating a legacy global store incrementally), how the UI framework turns state into screen updates (hooks and effect dependencies, re-render behaviour, memoization trade-offs, keys, update batching, concurrent rendering and transitions, plus the same ideas in Angular services and change detection), data-fetching patterns (server-state caching, stale-while-revalidate, optimistic updates and rollback, request deduplication, cursor pagination, normalized GraphQL caches, merging live socket events and partial failures into local state, undo and redo history), URL state and route-scoped data, micro-frontends and cross-team state ownership and isolation, framework-agnostic web components, event-bus communication between distant widgets, and rendering strategy trade-offs (CSR, SSR, hydration and mismatches, progressive enhancement). Covers designing a frontend that scales in complexity without becoming brittle. Reusable component libraries as design systems, form and dialog implementation, accessibility practice, render-speed tuning, language typing mechanics, browser storage APIs and offline persistence, conflict-resolution protocols for collaborative editing, and testing strategy are covered elsewhere.

MediumSystem Design
103 practiced

A React codebase has grown from 5 to 60 engineers and the components folder is a flat dump of 400 files. How would you reorganize it, and what rules would you set so new code lands in the right place without a gatekeeper?

MediumTechnical
88 practiced

Build a small global store in React for a shopping cart (add, remove, clear) that any component can read and update, so that a component showing only the item count does not re-render when an unrelated field changes. Show the code.

EasyTechnical
74 practiced

This component renders {items.length && <List items={items} />} and the page shows a stray 0 whenever the list is empty. Explain why it happens and describe the conditional rendering approaches you would use in JSX and when each is the right choice.

MediumTechnical
80 practiced

After a user edits their name, the header still shows the old one while the profile page shows the new one. What is likely wrong with the state design, and how do you restructure it so there is a single source of truth, including a derived value like a cart total?

MediumTechnical
79 practiced

Two setState calls in a click handler produce one render, but the same two calls inside a setTimeout used to produce two. Explain batching and what changed in React 18.

Unlock Full Question Bank

Get access to all Frontend Component and State Architecture interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.