Interview practice

Frontend Developer (React)

0–2 years · Junior — React · JavaScript / TypeScript · State management · CSS · Performance · Accessibility

0–2 years 2–5 years 5–8 years 8+ years
technical React Hooks 1 of 6
Using useEffect, you notice that a side effect runs multiple times instead of just once as intended. How do you diagnose the cause?
What a strong answer covers

Checks the dependency array to ensure it's set correctly; considers whether the effect depends on any state or props that might change; uses console.log to track when the effect runs; mentions cleaning up effects if necessary.

The follow-up you would get

What happens if you omit the dependency array entirely?

Could you have answered that?
scenario Error Handling 2 of 6
You are integrating a third-party API, and the response structure is inconsistent, leading to errors in your application. What do you do in the initial moments?
What a strong answer covers

Logs the responses to understand inconsistencies; creates a temporary error boundary to catch and log errors; checks API documentation for changes; considers implementing fallback values or defaults; discusses potential solutions with the team.

The follow-up you would get

The API is critical and often changes. How would you set up a more robust solution to handle these fluctuations in the future?

Could you have answered that?
scenario Performance 3 of 6
After a new feature rollout, users report that the application feels sluggish. What is your immediate approach to identify the performance bottleneck?
What a strong answer covers

Runs performance profiling tools to monitor render times; identifies components that are re-rendering unnecessarily; checks for large bundle sizes or heavy assets; isolates the new feature to see if it introduces delays; consults browser dev tools for network performance.

The follow-up you would get

You discover a large image is causing delays. What strategies do you employ to optimise asset loading and improve performance?

Could you have answered that?
ownership A migration that caused issues 4 of 6
Can you tell me about a migration to a new version of React or a library that led to unexpected challenges?
What a strong answer covers

Names the specific version or library migrated to and the reasons for the migration; describes the challenges encountered during the process; explains how those challenges were identified and addressed; discusses the timeline of the migration and any trade-offs made; avoids placing blame on external sources.

The follow-up you would get

What would you have monitored more closely during the migration?

Could you have answered that?
technical React Performance 5 of 6
A component that used to render instantly now takes two seconds to display after the state has changed. What do you investigate first to diagnose the issue?
What a strong answer covers

Checks for unnecessary re-renders by using React DevTools; examines component's props and state for changes; looks for memoisation opportunities with React.memo or useMemo; considers the impact of heavy computations in render.

The follow-up you would get

What can you do to prevent re-rendering of child components?

Could you have answered that?
technical State Management 6 of 6
You are using useState for managing form inputs, and the initial state does not reflect the current values after a user has interacted with the form. How do you resolve this issue?
What a strong answer covers

Ensures that state is updated correctly with onChange handlers; checks if the initial state is being set correctly on component mount; considers using useEffect to sync state with props if needed; mentions controlled vs uncontrolled components.

The follow-up you would get

What are the implications of using uncontrolled components in this scenario?

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.