MERN Stack Interview Questions: Full-Stack Scenarios Freshers Face in 2026

Prepare the connected MERN scenarios fresher interviews use, from React hooks and Express middleware to MongoDB modelling and a complete request trace.

KnowledgeGate Team

Exam prep & CS education

Updated 3 Sep 20266 min read

MERN interviews for freshers rarely stay inside one layer. The stronger questions ask what happens between a button click in React and a new document in MongoDB. If you prepared React, Node and MongoDB as separate lists, that join can make you freeze. The answer is to rehearse one request across the whole stack, with the data shape and failure points clear at every hop.

The four layers and what each interview segment tests

MERN stands for MongoDB, Express, React and Node. Each part has a distinct job, but an interviewer wants to know whether you can connect them.

  • React builds the interface from components, manages client state and responds to user events. Expect hooks, rendering, forms and state questions.

  • Node runs JavaScript on the server. Expect the event loop, asynchronous work and the cost of blocking code.

  • Express organises HTTP routes and middleware on top of Node. Expect request validation, authentication, status codes and error handling.

  • MongoDB stores documents. Mongoose commonly supplies schemas, validation and model methods in a Node application. Expect CRUD operations and data-modelling choices.

A fresher round may sample one or two questions from each layer, then join them in a scenario. Pair this web-stack revision with the coding and skill development courses, since most placement processes test problem solving in the same week as stack knowledge.

React questions that decide the round

Know the difference between useState and useEffect. useState stores state that affects rendering. useEffect synchronises a component with something outside the render calculation, such as a network request, timer or browser API.

Consider this hook:

useEffect(() => {
  fetchTodos();
}, []);

The empty dependency array means the effect runs after the component first mounts. Remove [], and it runs after every render. If fetchTodos() updates state, that update triggers another render, which runs the effect again. That is the loop the interviewer wants you to trace, not merely label.

Also be ready for controlled inputs, where React state supplies the input value and an event handler updates it, versus uncontrolled inputs, where the DOM retains the current value. Explain why list items need a stable key: React uses it to match an item across renders. An array index is risky when items can be inserted, removed or reordered.

Lifting state up means moving shared state to the nearest common parent and passing data and callbacks down. Direct mutation such as todos.push(newTodo) is a trap because React has not received a new array reference. Prefer setTodos(current => [...current, newTodo]).

Use React interview questions for freshers to drill the layer-specific follow-ups after you can explain this wider request flow.

Node and Express questions on async work and middleware

Node executes JavaScript on one main thread and handles many I/O operations without waiting synchronously for each one to finish. That does not make every task free. A long synchronous calculation blocks the event loop, so other requests cannot make progress on that thread until it ends.

Express middleware runs in the order in which it is registered. A middleware function can inspect or change req, write a response, call next() to continue, or pass an error with next(err). If it neither responds nor continues, the request hangs.

An async route should make its failure path visible:

app.post('/api/todos', validateTodo, async (req, res, next) => {
  try {
    const todo = await Todo.create(req.body);
    res.status(201).json(todo);
  } catch (error) {
    next(error);
  }
});

The route waits for the database operation, returns a creation response on success and forwards failures to central error-handling middleware. Common probes are what happens if you forget await, how callbacks differ from promises, and why an unhandled rejected promise is dangerous. Rehearse each of those until you can explain the runtime behaviour without hesitating.

MongoDB and Mongoose modelling questions

MongoDB stores BSON documents in collections rather than rows in relational tables. A Mongoose schema describes the expected fields and validation rules in the application. A model created from that schema exposes operations such as create, find and updateOne.

The high-signal modelling question is whether to embed or reference. Embed a small, bounded group of data that belongs to one parent and is normally read with it. Reference data that grows independently, is shared, or needs its own access pattern. For users and posts, keeping posts in a separate collection with an author reference avoids making one user document grow with every post. An interviewer may then ask about populating the author, indexing the reference or fetching a user's latest posts.

Do not stop at naming collections. State the relationship, the likely read path, the growth pattern and what must be indexed. That is a design answer rather than a memorised MongoDB slogan.

The full-stack scenario traced end to end

Suppose a user types Buy milk and presses Add. Say these six lines in order and an interviewer can follow the whole request without interrupting you. The MERN request lifecycle from React to MongoDB works through the mechanics of each hop in depth, including where the browser and database boundaries sit. An interview answer needs that same route compressed to something you can say in under a minute.

  1. React handles the form submission and calls axios.post('/api/todos', { text: "Buy milk" }).

  2. Express matches POST /api/todos. Validation middleware checks the body before the handler reads req.body.

  3. The handler calls Todo.create({ text: "Buy milk", done: false }) through Mongoose.

  4. MongoDB stores a document shaped like { _id: ObjectId(...), text: "Buy milk", done: false }.

  5. Express returns 201 with the new todo in JSON.

  6. React receives the document and calls setTodos(current => [...current, newTodo]), producing a new array and re-rendering the list.

A full-stack request flow for adding a todo, from React through Express and Mongoose to MongoDB and back to a React re-render.

If validation fails, the request should stop before insertion and return a clear client error. If the database fails, central error middleware should form the response without exposing internal details. A good interview trace includes both the happy path and one failure path.

The traps that sink freshers

In React, direct state mutation, unstable keys and effects with incorrect dependencies cause bugs that look mysterious only when the render cycle is unclear. A stale closure can also make a callback read an older state value, which is why the functional state update is useful in the todo trace.

In Node and Express, forgetting await, swallowing an error or doing heavy synchronous work damages correctness or responsiveness. Middleware order matters too. An authentication check registered after a protected handler cannot protect that handler.

Across the stack, expect CORS questions when a React development server on port 3000 calls an API on port 5000. The browser sees different origins, so the API must allow the intended origin. Security follow-ups often compare a JWT in localStorage, where injected script can read it, with an httpOnly cookie, which client-side JavaScript cannot read but which still needs appropriate CSRF and cookie controls.

How the interview probes the stack

Expect a request walk-through, a small live task and follow-ups. The task may be a component, an endpoint or a model. Follow-ups usually test input validation, error handling, state updates and whether the solution still works as data grows.

Answer from the user action outward. Name the HTTP method and path, show the request body, identify middleware, state the database operation, give the response status and explain the client update. More than 600 MERN-stack practice questions are live in KnowledgeGate's practice bank, covering JavaScript, React, Node, Express and MongoDB, so use practice to expose weak joins between the layers.

Short version and next step

Learn each layer's core questions, then rehearse one exact request across all four. If you can trace Buy milk from form state to a MongoDB document and back to a React re-render, including validation and failure handling, you can answer the fresher round as a full-stack developer.

Build and defend that flow in the MERN Stack course. Pair it with the MERN Stack and DSA bundle when your shortlist process also includes data structures and coding rounds.