Interview practice

Frontend Developer (React)

2–5 years · Mid — React · JavaScript / TypeScript · State management · CSS · Performance · Accessibility

0–2 years 2–5 years 5–8 years 8+ years
technical State Management 1 of 6
You are managing complex state across several components in a React app. The state updates are causing unintended side effects in sibling components. How do you approach fixing these issues?
What a strong answer covers

Analyses how state is lifted and shared among components; checks for direct mutations and improper side effects; considers using useReducer for managing complex state logic; evaluates whether a context provider is appropriate for global state management.

The follow-up you would get

What tools or libraries could assist in tracking state changes and their impacts?

Could you have answered that?
technical Debugging 2 of 6
A component's state is unexpectedly resetting during re-renders, leading to a loss of user input. How do you investigate this issue?
What a strong answer covers

Checks the component's lifecycle methods for state resets; reviews any external state management solutions being used; employs console logs to track state changes; considers whether the component is being unmounted and remounted unnecessarily.

The follow-up you would get

What additional debugging tools or techniques might help in identifying state issues?

Could you have answered that?
technical Rendering 3 of 6
You notice that a large list of items in your React application is causing a significant delay in rendering. What strategies can you employ to improve the rendering performance?
What a strong answer covers

Implements windowing or virtualisation techniques (e.g., react-window or react-virtualized); checks for unnecessary re-renders by profiling the component; breaks the list into smaller components; considers lazy loading data or components as needed.

The follow-up you would get

If rendering time is still excessive, what further optimisations could you explore?

Could you have answered that?
scenario Component Design 4 of 6
A product manager wants to introduce a new UI component that combines several existing components but has strict performance requirements. How do you approach the design and implementation?
What a strong answer covers

Analyzes existing components for reusability; plans a new component structure to minimise props drilling; uses React.lazy for code splitting; applies memoization to prevent unnecessary renders; collaborates with the product manager to clarify performance metrics.

The follow-up you would get

After implementing the component, performance still isn't meeting expectations. What additional steps do you take to troubleshoot and enhance performance?

Could you have answered that?
scenario State Management 5 of 6
A new feature requires you to integrate a third-party state management library into your existing React application. However, the integration is causing conflicts with your current state logic. What do you do in the first half hour?
What a strong answer covers

Identifies the conflicting state variables and logic; checks compatibility of the new library with existing state management; isolates the feature in a separate branch; begins to refactor state logic to accommodate the new library; considers using context or reducers for efficient state handling.

The follow-up you would get

The conflicts persist even after refactoring. What measures do you take to evaluate whether to stick with the new library or revert to the old state management solution?

Could you have answered that?
ownership A disagreement with a team member 6 of 6
Describe a time when you disagreed with a colleague about a technical approach in a project. How did you resolve it?
What a strong answer covers

Identifies the specific disagreement and its context; explains the rationale behind each perspective; describes the method used to facilitate a discussion or reach a compromise; details the eventual outcome and any lessons learned; avoids attributing blame.

The follow-up you would get

What would you do differently in a similar situation now?

Could you have answered that?
That is this set.

Load six more — you will get questions you have not seen first.

Give me six more →

Say your answer out loud before revealing. Reading the answer first feels like learning and is not.