MERN Stack Technical Round Questions & Answers
40 questions for the technical round stage — 4 easy, 27 medium, 9 hard.
About the technical round round
The technical round is the core of a MERN Stack interview: concept questions with follow-ups, a live hands-on task and a deep dive into one of your projects. Interviewers check depth, not just definitions.
Tips for the technical round round
- Say your approach out loud before you start writing.
- After a correct answer, expect 'why?' and 'what if?' follow-ups; go one level deeper than the question.
- Pick one project you can explain end to end, including what you would do differently.
- If you get stuck, explain what you would try next instead of going silent.
What are React fragments and portals?
Show answer
What does React.memo do and when is it useful?
Show answer
Write an aggregation that counts orders and sums revenue per status.
Show answer
Your app needs user, editor and admin roles with different permissions. How would you implement it?
Show answer
An error in one dashboard widget crashes the entire React page. How do you contain it?
Show answer
Implement page-based pagination for a products API with Mongoose.
Show answer
What are BSON and ObjectId in MongoDB?
Show answer
What is the aggregation pipeline and what are its common stages?
Show answer
Why do applications use both access tokens and refresh tokens?
Show answer
Compare session-based authentication with JWT-based authentication.
Show answer
Set a refresh token in a secure httpOnly cookie after login.
Show answer
When a user logs out or changes password, how do you make sure their existing JWTs stop working?
Show answer
Should you store a JWT in localStorage or in an httpOnly cookie?
Show answer
Your script crashes with out of memory while reading a 5 GB log file. How would you rewrite it?
Show answer
Write an asyncHandler wrapper for Express 4 route handlers.
Show answer
Write a Redux Toolkit slice that fetches products with createAsyncThunk.
Show answer
What are replica sets and sharding in MongoDB, and how do you choose a shard key?
Show answer
Write a central error-handling middleware with a custom AppError class.
Show answer
Write a register endpoint that hashes the password with bcrypt.
Show answer
Write an Express middleware that verifies a JWT from the Authorization header.
Show answer
Write a Supertest integration test for a POST /api/users endpoint.
Show answer
Fetch a list of users from an API inside useEffect with proper cleanup.
Show answer
What is libuv and which operations use the Node.js thread pool?
Show answer
Write a role-based authorization middleware for Express.
Show answer
Explain the phases of the Node.js event loop.
Show answer
Compare worker_threads, cluster and child_process in Node.js.
Show answer
Explain CSR, SSR, hydration and React Server Components.
Show answer
How would you structure the folders of a production Express API?
Show answer
What practical steps do you take to sanitise and validate input in an Express and MongoDB API?
Show answer
What does lean() do in Mongoose and when should you use it?
Show answer
Write a function to flatten a nested array without using Array.prototype.flat.
Show answer
How would you use Redis caching in a MERN backend and what are the pitfalls?
Show answer
What is the difference between a shallow copy and a deep copy?
Show answer
What is a custom hook and what rules must hooks follow?
Show answer
How does async/await improve on Promise chains, and how do you handle errors with it?
Show answer
What is the difference between useMemo and useCallback?
Show answer
Implement a shopping cart with useReducer.
Show answer
What is the Context API and when should you avoid it?
Show answer
Write a counter component using useState.
Show answer
Frequently asked questions
What happens in the MERN Stack technical round round?
The technical round is the core of a MERN Stack interview: concept questions with follow-ups, a live hands-on task and a deep dive into one of your projects. Interviewers check depth, not just definitions.
How do I clear the technical round round?
Say your approach out loud before you start writing. After a correct answer, expect 'why?' and 'what if?' follow-ups; go one level deeper than the question. Pick one project you can explain end to end, including what you would do differently.
Which round comes next?
A typical order is online assessment, telephonic screening, one or two technical rounds, a managerial round and HR. Use the other round pages to practise each stage.