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
scenario Error Handling 1 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?
ownership A migration that caused issues 2 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 State Management 3 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?
technical React Performance 4 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?
scenario State Management 5 of 6
You need to implement a new feature that relies on global state, but the existing state management is causing conflicts with other components. What do you do in the first few minutes?
What a strong answer covers

Identifies the conflicting state and its impact on components; reviews the current state management structure; considers whether to refactor existing state or create a new slice; checks for unnecessary re-renders; consults documentation or team members regarding best practices.

The follow-up you would get

The feature requires real-time updates. How do you ensure the new state management solution can handle this without performance degradation?

Could you have answered that?
technical CSS 6 of 6
A layout that looks fine on desktop is broken on mobile devices, causing elements to overlap. What steps do you take to troubleshoot this issue?
What a strong answer covers

Checks media queries to ensure they are correctly applied; inspects the box model with browser dev tools to identify overflow; looks for fixed widths that may not be responsive; considers flexbox or grid for layout adjustments.

The follow-up you would get

What tools or techniques do you use to test responsiveness?

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.