MERN Stack Quiz (Beginner) - All Questions
This beginner-friendly MERN Stack quiz covers core concepts of MongoDB, Express.js, React, and Node.js with easy and practical MCQs. Perfect for students, freshers, and beginners starting full-stack web development or preparing for interviews.
Question 1: What does MERN stand for?
- MongoDB, Express, React, Node
- MySQL, Express, React, Node
- MongoDB, Ember, React, Node
- MongoDB, Express, Redux, Node
Explanation: MERN stands for MongoDB, Express.js, React, and Node.js.
Question 2: Which part of MERN is used for frontend development?
- MongoDB
- Node.js
- React
- Express.js
Explanation: React is used to build the frontend UI.
Question 3: Which component of MERN is a NoSQL database?
- MySQL
- MongoDB
- PostgreSQL
- Oracle
Explanation: MongoDB is a NoSQL document-based database.
Question 4: Which language is mainly used across the MERN stack?
Explanation: JavaScript is used across frontend and backend in MERN.
Question 5: What is Node.js primarily used for?
- UI design
- Server-side development
- Database storage
- Styling
Explanation: Node.js is used to build server-side applications.
Question 6: What is Express.js?
- Frontend framework
- Database
- Node.js framework
- Testing library
Explanation: Express.js is a backend framework for Node.js.
Question 7: Which React feature helps build reusable UI?
- Hooks
- Components
- Reducers
- Services
Explanation: Components allow reusable UI building blocks.
Question 8: Which command initializes a Node.js project?
- node init
- npm start
- npm init
- node start
Explanation: npm init initializes a Node.js project.
Question 9: Which file stores Node.js project dependencies?
- index.js
- package.json
- server.js
- config.js
Explanation: package.json stores dependencies and scripts.
Question 10: Which React hook is used to manage state?
- useEffect
- useState
- useRef
- useMemo
Explanation: useState is used to manage component state.
Question 11: Which HTTP method is used to fetch data?
Explanation: GET is used to retrieve data from server.
Question 12: Which HTTP method creates new data?
Explanation: POST is used to create new resources.
Question 13: Which database format does MongoDB use?
- Tables
- Rows
- Documents
- Sheets
Explanation: MongoDB stores data as documents.
Question 14: Which MongoDB format is used to store data?
Explanation: MongoDB internally stores data as BSON.
Question 15: Which command starts a React app?
- npm build
- npm run dev
- npm start
- npm init
Explanation: npm start runs the React development server.
Question 16: Which React hook is used for side effects?
- useState
- useEffect
- useReducer
- useContext
Explanation: useEffect handles side effects like API calls.
Question 17: Which Express method defines routes?
- app.route()
- app.use()
- app.get()
- app.config()
Explanation: app.get() defines GET routes.
Question 18: Which middleware parses JSON in Express?
- bodyParser
- express.json()
- jsonParser()
- dataParser()
Explanation: express.json() parses incoming JSON.
Question 19: Which tool manages MongoDB locally?
- MongoDB Compass
- phpMyAdmin
- Workbench
- Studio
Explanation: MongoDB Compass is a GUI tool for MongoDB.
Question 20: Which React syntax allows HTML in JavaScript?
Explanation: JSX allows writing HTML inside JavaScript.
Question 21: Which file is the entry point of a React app?
- App.js
- index.js
- main.js
- root.js
Explanation: index.js is the entry point.
Question 22: Which MongoDB command inserts data?
- find()
- insertOne()
- update()
- deleteOne()
Explanation: insertOne() adds new data to MongoDB.
Question 23: Which Node.js module handles file system operations?
Explanation: fs module handles file operations.
Question 24: Which HTTP status code means success?
Explanation: 200 indicates a successful request.
Question 25: Which React hook shares data globally?
- useState
- useEffect
- useContext
- useMemo
Explanation: useContext shares data across components.
Question 26: Which library is commonly used for routing in React?
- React Route
- React Router
- RouterJS
- RouteX
Explanation: React Router handles client-side routing.
Question 27: Which file stores environment variables in MERN apps?
- .env
- config.js
- env.json
- vars.txt
Explanation: .env stores environment variables.
Question 28: Which MongoDB method retrieves data?
- insert()
- find()
- add()
- push()
Explanation: find() retrieves documents.
Question 29: Which Node.js framework is used in MERN?
Explanation: Express.js is commonly used in MERN.
Question 30: Which React hook optimizes performance?
- useMemo
- useState
- useEffect
- useContext
Explanation: useMemo memoizes expensive calculations.
Question 31: Which port does React usually run on?
Explanation: React runs on port 3000 by default.
Question 32: Which port does Node.js commonly run on?
Explanation: 5000 is commonly used for Node servers.
Question 33: Which tool sends HTTP requests for testing APIs?
Explanation: Postman is used for API testing.
Question 34: Which command installs dependencies?
- npm build
- npm install
- npm start
- npm push
Explanation: npm install installs dependencies.
Question 35: Which React hook references DOM elements?
- useState
- useEffect
- useRef
- useContext
Explanation: useRef accesses DOM elements.
Question 36: Which MongoDB port is default?
Explanation: MongoDB runs on port 27017.
Question 37: Which Express method handles middleware?
- app.use()
- app.get()
- app.post()
- app.listen()
Explanation: app.use() applies middleware.
Question 38: Which React feature updates UI efficiently?
- Shadow DOM
- Virtual DOM
- Real DOM
- Browser DOM
Explanation: Virtual DOM improves UI performance.
Question 39: Which Node.js function starts the server?
- app.run()
- server.start()
- app.listen()
- node.start()
Explanation: app.listen() starts the server.
Question 40: Which MongoDB operation updates data?
- insertOne()
- updateOne()
- find()
- remove()
Explanation: updateOne() updates documents.
Question 41: Which React hook handles component lifecycle?
- useState
- useEffect
- useContext
- useRef
Explanation: useEffect handles lifecycle events.
Question 42: Which file usually contains Express routes?
- routes.js
- index.html
- package.json
- config.env
Explanation: routes.js commonly defines routes.
Question 43: Which MERN component connects to database?
Explanation: Express and Node handle database connections.
Question 44: Which library connects Node.js with MongoDB?
- MongoClient
- Mongoose
- Sequelize
- TypeORM
Explanation: Mongoose connects Node.js with MongoDB.
Question 45: Which MongoDB library provides schemas?
- MongoClient
- Compass
- Mongoose
- Axios
Explanation: Mongoose provides schema support.
Question 46: Which React hook avoids prop drilling?
- useEffect
- useState
- useContext
- useMemo
Explanation: useContext avoids prop drilling.
Question 47: Which MERN layer handles API logic?
- Frontend
- Database
- Backend
- UI
Explanation: Backend handles API and business logic.
Question 48: Which format is commonly used in MERN APIs?
Explanation: JSON is commonly used for APIs.
Question 49: Which Node.js package manages environment variables?
Explanation: dotenv loads environment variables.