All India Jobs
HomeBlogJobsCompaniesAboutLearn ResourceInterview Questions
Search
All India Jobs

Jobs and Blogs for people who build.

Read
  • Blogs
  • Categories
  • Search
Company
  • About
  • Contact
  • Privacy
  • Terms
© 2026 All India Jobs. All rights reserved.
InstagramWhatsAppRSS
All India Jobs
HomeBlogJobsCompaniesAboutLearn ResourceInterview Questions
Search

mern Interview Questions

Q1.

What is React?

Answer:

React is a JavaScript library for building UIs.

Difficulty: Easy
Q2.

What is React?

Answer:

React is a JavaScript library used for building user interfaces using reusable components.

Difficulty: easy
Q3.

What is Virtual DOM?

Answer:

Virtual DOM is a lightweight copy of the real DOM. React compares Virtual DOM changes and updates only the required parts of the actual DOM.

Difficulty: easy
Q4.

What are React Components?

Answer:

Components are reusable pieces of UI. They can be Functional Components or Class Components.

Difficulty: easy
Q5.

What is JSX?

Answer:

JSX is JavaScript XML. It allows developers to write HTML-like syntax inside JavaScript.

Difficulty: easy
Q6.

What is the difference between State and Props?

Answer:

Props are passed from parent to child and are read-only. State is managed inside the component and can be updated.

Difficulty: easy
Q7.

What is useState?

Answer:

useState is a React Hook used to add state management in functional components.

Difficulty: easy
Q8.

What is useEffect?

Answer:

useEffect is used to perform side effects such as API calls, subscriptions, and DOM updates.

Difficulty: medium
Q9.

What is React Router?

Answer:

React Router is a library used for navigation and routing in React applications.

Difficulty: medium
Q10.

What is Context API?

Answer:

Context API provides a way to share data globally without prop drilling.

Difficulty: medium
Q11.

What is Redux?

Answer:

Redux is a state management library used to manage application-wide state.

Difficulty: medium
Q12.

Explain React Lifecycle.

Answer:

Lifecycle methods include Mounting, Updating, and Unmounting phases. Hooks such as useEffect are commonly used instead of lifecycle methods in functional components.

Difficulty: medium
Q13.

What is Lazy Loading in React?

Answer:

Lazy loading loads components only when needed, improving application performance.

Difficulty: medium
Q14.

Create a counter using useState.

Answer:

const [count,setCount]=useState(0); <button onClick={()=>setCount(count+1)}>Increment</button>

Difficulty: easy
Q15.

Fetch API data using useEffect.

Answer:

useEffect(()=>{ fetch('/api/users').then(res=>res.json()).then(data=>setUsers(data)); },[]);

Difficulty: medium
Q16.

Implement a search filter in React.

Answer:

Use useState for search text and filter the array using filter() and includes().

Difficulty: medium
Q17.

Create a Todo Application.

Answer:

Use useState to manage todos and implement Add, Delete, and Update functionality.

Difficulty: medium
Q18.

Implement Dark Mode Toggle.

Answer:

Maintain theme state using useState and conditionally apply CSS classes.

Difficulty: medium
Q19.

Build Pagination Component.

Answer:

Use current page state and slice() method to display paginated data.

Difficulty: hard
Q20.

Create Custom Hook for API Calls.

Answer:

Create a reusable hook that manages loading, error, and data states.

Difficulty: hard
Q21.

Optimize a React Application.

Answer:

Use React.memo, useMemo, useCallback, lazy loading, and code splitting.

Difficulty: hard
Q22.

What is the MERN Stack?

Answer:

MERN stands for MongoDB, Express.js, React.js, and Node.js. It is a full-stack JavaScript technology stack used to build web applications.

Difficulty: easy
Q23.

What is the difference between SQL and MongoDB?

Answer:

SQL databases use tables and rows, while MongoDB is a NoSQL database that stores data in JSON-like documents.

Difficulty: easy
Q24.

What is Mongoose?

Answer:

Mongoose is an ODM (Object Data Modeling) library for MongoDB and Node.js that provides schema-based data modeling.

Difficulty: easy
Q25.

What is middleware in Express.js?

Answer:

Middleware functions execute during the request-response cycle and can modify request, response, or end the cycle.

Difficulty: medium
Q26.

What is JWT Authentication?

Answer:

JWT (JSON Web Token) is a secure way to authenticate users by generating a token after login and validating it on protected routes.

Difficulty: medium
Q27.

Why do we use bcrypt?

Answer:

bcrypt is used to hash passwords before storing them in the database, improving security.

Difficulty: medium
Q28.

What is the difference between authentication and authorization?

Answer:

Authentication verifies who the user is, while authorization determines what the user is allowed to access.

Difficulty: medium
Q29.

What are React Hooks?

Answer:

Hooks allow functional components to use state and lifecycle features. Examples are useState, useEffect, useMemo, and useCallback.

Difficulty: easy
Q30.

What is useMemo?

Answer:

useMemo memoizes computed values and prevents unnecessary recalculations during re-renders.

Difficulty: medium
Q31.

What is useCallback?

Answer:

useCallback memoizes functions and prevents unnecessary recreation of functions on re-renders.

Difficulty: medium
Q32.

What is React Context API?

Answer:

Context API allows data sharing across components without passing props manually through every level.

Difficulty: medium
Q33.

How do you make API calls in React?

Answer:

Using fetch() or axios inside useEffect or event handlers.

Difficulty: easy
Q34.

What is CORS?

Answer:

Cross-Origin Resource Sharing is a browser security feature that controls access between different origins.

Difficulty: medium
Q35.

What is REST API?

Answer:

REST API is an architectural style that uses HTTP methods such as GET, POST, PUT, and DELETE to manage resources.

Difficulty: easy
Q36.

What is event loop in Node.js?

Answer:

The event loop allows Node.js to perform non-blocking I/O operations using asynchronous callbacks.

Difficulty: hard
Q37.

Create Login API using Express and JWT.

Answer:

Validate user credentials, compare hashed password using bcrypt, generate JWT token, and return it.

Difficulty: medium
Q38.

Create Protected Route using JWT Middleware.

Answer:

Read token from headers, verify JWT, and allow access only for authenticated users.

Difficulty: medium
Q39.

Implement CRUD Operations using MongoDB and Express.

Answer:

Create, Read, Update, and Delete documents using Mongoose models.

Difficulty: easy
Q40.

Build a Todo Application using React.

Answer:

Use useState, map(), and CRUD APIs to manage tasks.

Difficulty: easy
Q41.

Implement Search Filter in React.

Answer:

Use filter() and state management to search data dynamically.

Difficulty: easy
Q42.

Implement Pagination in React.

Answer:

Use slice() and page state to display paginated data.

Difficulty: medium
Q43.

Create File Upload API using Multer.

Answer:

Configure multer middleware and store uploaded files on the server.

Difficulty: medium
Q44.

Implement Role-Based Authentication (Admin/User/Vendor).

Answer:

Store roles in JWT and check permissions using middleware.

Difficulty: hard
s
All India Jobs

Jobs and Blogs for people who build.

Read
  • Blogs
  • Categories
  • Search
Company
  • About
  • Contact
  • Privacy
  • Terms
© 2026 All India Jobs. All rights reserved.
InstagramWhatsAppRSS