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 Rendering 1 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?
technical Performance 2 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 Accessibility 3 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?
scenario Performance Tuning 4 of 6
Your React application is experiencing frequent lag during user interactions, particularly on mobile devices. Walk me through your approach to diagnose and address the performance issues.
What a strong answer covers

Identifies performance bottlenecks using the React Profiler; checks for unnecessary re-renders and optimises components with memoization; analyses event handling to reduce processing time; evaluates network requests and lazy loading strategies; considers using Web Workers for heavy computations.

The follow-up you would get

You find several components re-rendering unnecessarily. What specific techniques do you employ to prevent this?

Could you have answered that?
scenario Accessibility 5 of 6
You receive feedback that your web application is not fully accessible, particularly for users relying on screen readers. What actions do you take to address the accessibility concerns?
What a strong answer covers

Conducts an accessibility audit using tools like axe or Lighthouse; reviews the semantic HTML structure for appropriate use of ARIA roles and properties; ensures all interactive elements are keyboard navigable; tests with actual screen readers for real-world usability; develops a checklist for future components to ensure ongoing compliance.

The follow-up you would get

You identify some components that are still not compliant. What specific changes would you implement to rectify these?

Could you have answered that?
scenario Component Design 6 of 6
You are tasked with redesigning a component that has grown too complex, making it hard to maintain. Describe how you would approach the refactoring process.
What a strong answer covers

Analyses the current component for single responsibility violations; identifies reusable parts and splits them into smaller components; implements hooks for shared logic; documents component interactions and props; ensures that new components have clear boundaries and follow best practices for props and state management.

The follow-up you would get

During refactoring, you realise some components need to remain in place for legacy support. How do you balance new designs with maintaining legacy code?

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.