Interview practice

Frontend Developer (React)

5–8 years · Senior — React · JavaScript / TypeScript · State management · CSS · Performance · Accessibility

0–2 years 2–5 years 5–8 years 8+ years
technical Data Flow 1 of 6
A complex data input form in your application is causing a significant lag in user input responsiveness. What strategies do you employ to improve the data flow and user experience?
What a strong answer covers

Implement debouncing on input fields to reduce the number of state updates; evaluate form management libraries for optimal performance; break down the form into smaller components to manage state closer to inputs; use local state where appropriate; profile component renders to identify bottlenecks.

The follow-up you would get

How does this approach change if the form is controlled versus uncontrolled?

Could you have answered that?
technical Accessibility 2 of 6
You are implementing a modal that is not receiving focus when opened, impacting keyboard navigation for screen reader users. How do you address this issue?
What a strong answer covers

Ensures the modal has a role of 'dialog' with proper aria-labelledby; uses focus management to set focus on the modal upon opening; implements an escape key handler to close the modal; verifies background elements are not focusable when the modal is active; tests with screen readers.

The follow-up you would get

How do you ensure that focus returns to the correct element after the modal is closed?

Could you have answered that?
technical State Management 3 of 6
Your application uses Redux for state management, but a specific action takes 600 milliseconds to reflect changes in the UI, causing user frustration. How do you investigate and optimise this?
What a strong answer covers

Looks at the action payload and reducer performance; checks for unnecessary state updates in connected components; profiles with Redux DevTools to identify slow state transitions; considers normalising state shape and using selectors; evaluates potential use of local state for non-global data.

The follow-up you would get

What if the performance issue is not in the reducer but in the component rendering?

Could you have answered that?
technical Performance 4 of 6
A React component with six child components is re-rendering every time the parent updates, causing a noticeable performance drop. What steps do you take to identify and resolve the issue?
What a strong answer covers

Uses React DevTools to profile renders; checks if props are changing unnecessarily; implements React.memo for functional components; considers using useCallback and useMemo for functions and values passed as props; reviews context usage to avoid unnecessary re-renders.

The follow-up you would get

What changes if the parent component is a class component?

Could you have answered that?
technical Rendering 5 of 6
You notice a significant increase in bundle size after adding a new library, impacting load times. How do you determine the cause and what steps do you take to mitigate the increase?
What a strong answer covers

Analyses the bundle with tools like Webpack Bundle Analyzer; checks for tree-shakable imports versus entire library imports; evaluates alternatives to the library that may be lighter; considers code-splitting to load components on demand; looks into optimising CSS and assets as well.

The follow-up you would get

What would you check if the bundle size increase is due to dependencies rather than direct imports?

Could you have answered that?
scenario State Management 6 of 6
A recent update introduced a new feature that requires global state management, but the current implementation is causing data inconsistencies across components. Explain how you would approach resolving this issue.
What a strong answer covers

Examines the state structure to identify sources of inconsistency; reviews component connections to the state and updates subscription logic; considers using selectors for derived state; discusses potential refactoring to a context API or Zustand for better management; ensures proper use of useReducer for complex state transitions.

The follow-up you would get

The new feature impacts load time. What steps do you take to ensure optimal performance while maintaining state consistency?

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.