Components can be either functional components (using functions) or class components (using ES6 classes). Functional components are simpler and recommended for most use cases, while class components have additional features like state and lifecycle methods.
Class and Function components
Controlled and Uncontrolled components
Pure components
Smart and Dumb components
Stateless and Stateful components
How would you decide whether to implement a simple toggle button as a function component or a class component?
If you create a presentational component that only renders UI, what props would you pass to keep it reusable across different pages?
What happens if you try to use state inside a functional component without using hooks?
We have a dashboard with a data‑fetching container component and several UI widgets. How would you structure the components, and why might you choose container vs presentational patterns?
During a code review a teammate converted a class component to a functional one but forgot to memoize a heavy child component, causing a slowdown. How would you diagnose and fix the regression?
You need to add a higher‑order component to inject authentication info into several pages. What trade‑offs should you consider compared to using React context?
Our app renders a large list with infinite scroll. Discuss the component architecture—pure components, memo, virtualization—you would use to keep rendering performant at scale.
We are migrating a legacy codebase that heavily uses class components and lifecycle methods to modern hooks. What migration strategy would you adopt to minimize risk and maintainability?
Design a reusable modal component that works across multiple teams, handling focus management, portal rendering, and theming while avoiding prop‑drilling.
At a company‑wide level we want to standardize component types (functional, class, HOC, render props) across dozens of repositories. How would you set up guidelines, tooling, and migration paths to enforce consistency without slowing feature velocity?
Discuss the long‑term architectural implications of favoring higher‑order components versus hooks for cross‑cutting concerns in a large micro‑frontend ecosystem.
If you need to support both legacy browsers that don’t understand hooks and modern browsers, how would you structure your component library to serve both without duplicating code?