MERN Stack Developer Interview Questions & Answers
40 questions for MERN Stack Developer interviews — 2 easy, 30 medium, 8 hard.
About the MERN Stack Developer role
A MERN stack developer builds complete applications with MongoDB, Express, React and Node.js, owning features from database schema to API to UI. They design REST endpoints, handle authentication with JWT or cookies, manage frontend state and deploy to cloud platforms. The role is popular in startups and mid-size product companies that want developers who can ship full features independently.
What is the difference between server state and client state?
Show answer
Your component fetches data in useEffect and the network tab shows thousands of requests in a loop. What could cause it?
Show answer
What is useId and why not use Math.random for ids?
Show answer
What does lifting state up mean?
Show answer
What is RTK Query?
Show answer
Tell me about a time you had to learn a new tool or library quickly.
Show answer
An accessibility audit says your signup form fails screen reader checks. What would you fix to make the form accessible?
Show answer
What is the difference between useMemo and useCallback?
Show answer
What is lazy initialisation in useState and when should you use it?
Show answer
A junior developer is confused about when to use useEffect. How would you explain it and help them?
Show answer
After adding an AuthContext at the root, profiling shows the whole app re-rendering every few seconds. What would you check?
Show answer
How do form Actions work in React 19?
Show answer
What is Zustand and how do you use it?
Show answer
What are the common approaches to form validation in React?
Show answer
A new mid-sized dashboard project is starting. How would you decide between Context, Redux Toolkit and Zustand?
Show answer
Users lose their typed data when they accidentally click another menu link. How would you warn them about unsaved changes?
Show answer
Show how to fetch data with TanStack Query.
Show answer
The linter shows a react-hooks/exhaustive-deps warning and a teammate wants to disable the rule. What do you advise?
Show answer
What is useEffectEvent?
Show answer
What is atomic state management, as in Jotai or Recoil-style libraries?
Show answer
Why is React Hook Form popular?
Show answer
Write a useDebounce custom hook.
Show answer
A developer sends an analytics event inside a useEffect that watches a 'submitted' state flag. Is this a good pattern?
Show answer
How do you persist part of your state, like the cart, across page reloads?
Show answer
You are building a 4-step onboarding wizard. How do you keep data when users move back and forth between steps?
Show answer
What are nested routes and what is the role of Outlet?
Show answer
What is a Higher-Order Component and is it still used?
Show answer
Tell me about a time a requirement changed late in a sprint. How did you handle it?
Show answer
Five components on one page each fetch the same user profile, causing duplicate API calls. How would you fix this?
Show answer
When would you use useLayoutEffect instead of useEffect?
Show answer
What is Redux middleware?
Show answer
What is an effect cleanup function and why is it important?
Show answer
What are loaders and actions in React Router?
Show answer
How do you upload a file with a preview in React?
Show answer
How would you implement an optimistic update with TanStack Query and roll back on failure?
Show answer
How would you explain to a non-technical manager why our marketing pages need server rendering?
Show answer
What is the use() API introduced in React 19?
Show answer
How do you create a protected route that redirects users who are not logged in?
Show answer
What are memoised selectors and why use createSelector?
Show answer
Frequently asked questions
What does a MERN Stack Developer do?
A MERN stack developer builds complete applications with MongoDB, Express, React and Node.js, owning features from database schema to API to UI. They design REST endpoints, handle authentication with JWT or cookies, manage frontend state and deploy to cloud platforms. The role is popular in startups and mid-size product companies that want developers who can ship full features independently.
Which skills are tested in a MERN Stack Developer interview?
Expect questions on Node.js and Express APIs, MongoDB, Authentication and security, Redux Toolkit or TanStack Query, Cloud deployment. Most rounds also ask you to explain a project and solve one practical problem live.
How do I prepare for a MERN Stack Developer interview?
Revise State Management, Routing and Forms, React Hooks first using the topic sheets, practise the questions on this page aloud, then do one full mock interview to practise timing.