📢
Admissions Open for August 2026 Batch | Free Career Counselling | Limited Scholarships
Register Now →

Interview Preparation

MERN Stack Interview Questions for Full Stack Developers

MERN stack interviews test JavaScript fundamentals first, then React rendering and hooks, then Node and Express API design, then MongoDB data modelling. For fresher roles the weighting sits heavily on core JavaScript and React, and most rejections come from shaky fundamentals rather than missing framework features.

JavaScript fundamentals, which carry the most weight

Explain var, let and const.

var is function scoped and hoisted with an initial value of undefined. let and const are block scoped and hoisted but stay in the temporal dead zone until declared. const prevents reassignment of the binding, not mutation of the object it points to, which is a very common follow-up.

What is a closure?

A function that retains access to variables from the scope where it was defined, even after that scope has finished executing. Closures are the basis of data privacy in JavaScript and of hooks like useState retaining values between renders.

Explain the event loop.

JavaScript runs on a single thread with a call stack. Asynchronous work is handed to the environment, and completed callbacks are queued. The event loop moves callbacks onto the stack when it is empty. Microtasks such as promise callbacks run before macrotasks such as setTimeout, which is the detail interviewers probe.

What is the difference between == and ===?

== compares after type coercion, === compares value and type without coercion. Use === by default. Being able to name a coercion surprise, such as null == undefined being true, signals real familiarity.

Explain promises and async/await.

A promise represents a value that will exist later, in pending, fulfilled or rejected state. async/await is syntax over promises that lets asynchronous code read sequentially. Always wrap await in try/catch, because an unhandled rejection is a common bug interviewers look for.

What is the difference between map, filter and reduce?

map transforms each element and returns an array of the same length. filter returns a subset. reduce collapses the array into a single accumulated value. All three return new arrays or values rather than mutating the original.

React

What is the virtual DOM and why does it exist?

An in-memory representation of the UI. React compares the new tree with the previous one and applies only the differences to the real DOM, because direct DOM manipulation is comparatively expensive.

Explain useState and useEffect.

useState adds local state to a function component and returns the value and a setter. useEffect runs side effects after render, with a dependency array controlling when it re-runs. An empty array means once after mount, and omitting the array entirely means after every render, which is a frequent source of infinite loops.

Why do lists need a key prop?

Keys let React identify which items changed between renders. Using an array index as a key causes incorrect behaviour when the list is reordered, filtered or has items removed, because identity shifts.

What is prop drilling and how do you avoid it?

Passing props through several intermediate components that do not use them. Avoid it with Context for genuinely global values, or a state management library for complex application state. Avoid reaching for Context prematurely, since it can cause wide re-renders.

What is the difference between controlled and uncontrolled components?

A controlled component has its value driven by React state, so React is the single source of truth. An uncontrolled component keeps its own internal state, read via a ref. Controlled is the default recommendation for forms.

What causes unnecessary re-renders and how do you fix them?

State changes high in the tree, new object or function identities passed as props each render, and context updates. Fixes include memoisation with React.memo, useMemo and useCallback, and moving state closer to where it is used. Mention that premature memoisation adds complexity for no benefit.

Node.js and Express

Why is Node considered non-blocking?

Because I/O operations are delegated and handled via callbacks rather than blocking the single main thread. CPU-heavy work does block it, which is why such work belongs in a worker thread or a separate service.

What is middleware in Express?

A function with access to the request, response and the next function, executed in order. Used for logging, authentication, body parsing and error handling. Error-handling middleware is distinguished by taking four arguments.

How would you implement authentication in a MERN app?

Commonly JWT: verify credentials, sign a token, and have the client send it on subsequent requests for the server to verify. Points that earn credit are hashing passwords with bcrypt, never storing plain passwords, keeping secrets out of source control, and discussing where the token is stored on the client and the trade-offs involved.

How do you handle errors in an Express API?

Centralised error-handling middleware, consistent status codes, and messages that do not leak internal detail to the client. Asynchronous route handlers need their rejections forwarded to next, or they will hang.

MongoDB

When would you embed documents versus reference them?

Embed when the data is read together and bounded in size, such as an address inside a user. Reference when the data is large, unbounded or shared across documents, such as orders belonging to a user. The deciding question is how the data is queried.

What is an index and what does it cost?

A structure that speeds up reads by avoiding a full collection scan. The cost is slower writes and additional storage, so index the fields you actually filter and sort on rather than everything.

What is the aggregation pipeline?

A sequence of stages such as $match, $group, $sort and $lookup that transform documents. Placing $match as early as possible is the standard performance point interviewers listen for.

Is MongoDB ACID compliant?

Single document operations are atomic. Multi-document transactions are supported in replica sets from version 4.0. If an application needs heavy multi-document transactional integrity, that is a legitimate reason to consider a relational database instead, and saying so shows judgement.

The project discussion

For fresher developer roles the project conversation often carries more weight than any single technical question. Be ready to explain your architecture, why you chose each part of the stack, the hardest bug you fixed and how you found it, and what you would build differently now. "I would do it the same way" is a weak answer at any experience level.

The AI-Powered Full Stack Development course ends in a team capstone built in sprints with code review, plus mock technical rounds, specifically so that this conversation is rehearsed rather than improvised.

Watch

How to Become a Full Stack MERN Developer

FAQ

Frequently Asked Questions

What is asked most in MERN stack interviews?

Core JavaScript fundamentals such as closures, the event loop and promises, then React hooks and rendering behaviour, then Express middleware and authentication, then MongoDB modelling. Fundamentals carry more weight than framework trivia for fresher roles.

Do I need data structures and algorithms for full stack roles?

Product companies and larger firms usually test them. Service companies, agencies and startups often weight practical project work more heavily. Prepare basic arrays, strings, hash maps and complexity reasoning at minimum.

How many projects should a fresher developer have?

Two or three that you can discuss deeply, including one deployed and running. Depth beats quantity, because interviewers probe rather than count.

Is MERN still in demand?

JavaScript across the stack remains widely used across Indian startups, agencies and IT services. More importantly, the underlying skills transfer, so the specific stack matters less than understanding how the pieces fit together.

Want This Mapped to Your Own Background?

A free counselling session will tell you which path fits, and will tell you honestly if none of ours does.

Book Free Career Counselling

Keep Reading

Related Articles