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
102 practiced

Widgets in a large single-page app that share no parent need to notify each other (a toast service, a global filter, a selection change). Sketch a small event bus for this: its API, how listeners are cleaned up so nothing leaks, how one-off listeners and grouping of events work, and what you do when an event fires hundreds of times a second.

HardSystem Design
93 practiced

You are asked to explain how a Redux-style store works by designing a tiny one. What primitives does it need, how would you let side effects such as API calls hook in without polluting reducers, and what does that buy you for debugging?

HardSystem Design
102 practiced

You are adding undo and redo to a document editor where each user action changes both application state and what is on screen. How do you model the history, how do you record actions without exhausting memory, and how do you restore a previous state correctly and efficiently?

That is every published Frontend Component and State Architecture question for Software Engineer so far. Browse the other topics in this category, or practice this one interactively.