InterviewStack.io LogoInterviewStack.io

Frontend Component and State Architecture Questions

Structuring client applications for maintainability: component architecture and code organization, state management and data flow, data-fetching patterns, routing and navigation, micro-frontends, and rendering strategy trade-offs. Covers designing a frontend that scales in complexity without becoming brittle.

MediumTechnical
95 practiced

Explain how to diagnose unnecessary component re-renders using React DevTools Profiler. Walk through a step-by-step debugging approach: reproduce the scenario, record a profile, inspect the flame graph and 'why did this render' information, check props/contexts/hooks, and apply fixes (memoization, splitting, moving state). Provide typical examples you would look for in the profiler.

EasyTechnical
79 practiced

Explain the difference between local component state and derived state in a modern frontend application (e.g., React). Describe criteria you would use to decide whether to keep state local, lift it to a parent, or compute it as derived. Include two concrete examples (one where you keep state local and one where you lift state) and explain the trade-offs for re-renders, testability, and single-source-of-truth.

EasyTechnical
134 practiced

Explain the difference between controlled and uncontrolled components in React. Provide concrete examples: a simple text input implemented as a controlled component using useState, and the same input as an uncontrolled component using refs. Describe pros/cons, when to choose each pattern (forms with many inputs, third-party widgets), and implications for testing, performance, and accessibility.

EasyTechnical
92 practiced

What is a stale closure in the context of React hooks? Provide a concise example (in JavaScript using useEffect or an event handler) showing how a closure can capture outdated state and list two practical ways to avoid this problem in component code.

MediumTechnical
99 practiced

Design a WindowSize component which subscribes to window resize events using useEffect and updates width and height in state. Implement proper cleanup to avoid memory leaks and explain how to debounce the resize handler inside the hook to reduce expensive re-renders while still keeping UI reasonably responsive.

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.