MCQ Quiz
What does MERN stand for in the context of web development?
A) MongoDB, Express, React, Node
B) MySQL, Express, React, Node
C) MongoDB, Express, Ruby, Node
D) MongoDB, Express, React, Nginx
Which database is used in the MERN stack?
A) MySQL
B) PostgreSQL
C) MongoDB
D) SQLite
What is the primary function of Express in the MERN stack?
A) Database management
B) Backend framework
C) Frontend framework
D) Version control
Which of the following is a state management library commonly used with React?
A) Redux
B) Angular
C) Vuex
D) jQuery
What is JSX in React?
A) A JavaScript library
B) A syntax extension for JavaScript
C) A CSS framework
D) A type of database
Which command is used to create a new React app?
A) npm create-react-app
B) npx create-react-app
C) react-init
D) npx init-react-app
In Node.js, which module is used to handle file system operations?
A) http
B) fs
C) path
D) url
What is the purpose of the useState hook in React?
A) To manage side effects
B) To handle HTTP requests
C) To add state to functional components
D) To manage routing
Which of the following is a valid way to import a module in Node.js?
A) import module from 'module'
B) require('module')
C) import 'module'
D) require module
What is the use of middleware in Express?
A) To handle database operations
B) To manage routing
C) To execute code during request/response cycle
D) To define component structure
Which of the following methods is used to send data from a React component to another component?
A) Props
B) State
C) Context
D) Refs
In MongoDB, what is a collection?
A) A single record
B) A group of databases
C) A group of documents
D) A type of index
What is the purpose of the useEffect hook in React?
A) To manage component state
B) To perform side effects in function components
C) To handle component lifecycle methods
D) To manage routing
Which HTTP method is used to update a resource in RESTful APIs?
A) GET
B) POST
C) PUT
D) DELETE
What is the command to start a Node.js application?
A) npm start
B) node app.js
C) node server
D) npm run
What does npm stand for?
A) Node Project Manager
B) Node Package Manager
C) New Project Manager
D) New Package Manager
In React, how do you handle events?
A) Using HTML event attributes
B) Using event listeners
C) Using event handlers
D) Using JavaScript functions
Which of the following is not a part of the MERN stack?
A) MySQL
B) Express
C) React
D) Node
What is the purpose of the package.json file in a Node.js project?
A) To define the project's metadata
B) To list the project's dependencies
C) To specify the project's scripts
D) All of the above
What is the command to install a package using npm?
A) npm get
B) npm add
C) npm install
D) npm download
What is the difference between state and props in React?
A) State is immutable, props are mutable
B) State is mutable, props are immutable
C) Both are immutable
D) Both are mutable
In Express, how do you define a route?
A) app.route()
B) app.get()
C) app.createRoute()
D) app.defineRoute()
What is the primary purpose of React Router?
A) To manage global state
B) To handle HTTP requests
C) To manage navigation and routing
D) To handle form submissions
In MongoDB, what is a document?
A) A single collection
B) A single database
C) A single record
D) A single field
Which of the following is a popular NoSQL database used with Node.js?
A) PostgreSQL
B) MongoDB
C) MySQL
D) SQLite
In React, what is a component?
A) A reusable piece of UI
B) A function to manage state
C) A way to handle events
D) A method to fetch data
Which command is used to start the MongoDB server?
A) mongo start
B) mongod
C) mongodb start
D) mongo init
What is the purpose of the useReducer hook in React?
A) To manage state
B) To handle side effects
C) To manage complex state logic
D) To manage routing
In Express, how do you parse incoming request bodies?
A) Using bodyParser middleware
B) Using urlencoded middleware
C) Using json middleware
D) All of the above
Which method is used to create a new document in MongoDB?
A) insert
B) save
C) create
D) insertOne