A class component requires you to extend from React.Component and create a render function that returns a React element.
Class components are based on ES6 classes and can have their own state and lifecycle methods.
How would you turn a simple counter widget into a class component?
What happens if you forget to bind an event handler in a class component?
Where and how do you initialize state in a class component's constructor?
We fetch data in componentDidMount, but the component leaks memory when unmounted. How would you fix it?
Why does a class component re‑render when setState is called with the same value, and how can you avoid unnecessary renders?
If a parent passes a new prop that doesn't affect rendering, what can you do to optimise the class component?
Our dashboard has dozens of class components with complex lifecycle logic. How would you refactor them for better maintainability and testability?
Discuss the trade‑offs between using shouldComponentUpdate and extending PureComponent in a large list rendering scenario.
When doing server‑side rendering, what extra considerations do class components introduce compared to functional components with hooks?
Our codebase is 80% class components and we plan to migrate to hooks over the next few years. How would you design a migration strategy that minimizes risk and keeps teams productive?
How would you create a shared base class for common behavior across many class components while avoiding tight coupling?
What architectural implications arise when mixing class components and functional components in a large app, and how would you enforce consistency?