Mern Technology Screening TestBy Collab Team Contributor / February 7, 2025 MERN Technology Screening Test 1 / 20 Which command provides a detailed execution plan of a MongoDB query? explain("executionStats") find().stats() profile() queryPlanner() 2 / 20 What does process.nextTick() do in Node.js? Pauses the event loop Executes a function in the next event loop iteration Runs a function immediately Delays function execution indefinitely 3 / 20 Which of the following is a recommended way to perform transactions in MongoDB? Using updateMany() Using findAndModify() Using bulkWrite() Using a replica set and startSession() 4 / 20 What does req.params contain in an Express route handler? HTTP headers Route parameters from the URL Request body Query string parameters 5 / 20 What will happen if a function component in React returns null? It will throw an error It will default to rendering an empty <div> It will crash the application It will render nothing 6 / 20 In React, why should we use keys in lists? To manage event handlers efficiently To improve performance by helping React identify changes To style list elements dynamically To store additional metadata 7 / 20 How do you handle errors globally in an Express.js application? Using res.send(error.message) Using process.exit() Using throw new Error() Using a middleware with (err, req, res, next) signature 8 / 20 Which built-in Node.js module is used to create an HTTP server? http fs net events 9 / 20 What is the primary purpose of using express.static()? To handle dynamic data rendering To define API routes To serve static files such as images and CSS To define middleware for error handling 10 / 20 Which Node.js module is used to work with file systems? http fs path stream 11 / 20 Which middleware is commonly used to parse JSON request bodies in Express.js? multer cookie-parser body-parser express-validator 12 / 20 Which of the following statements is true about Express.js routing? Routes can be defined using app.use() Middleware runs after route handlers by default Routes support HTTP methods like GET, POST, PUT, DELETE Routes must always be defined in separate files 13 / 20 Which of the following methods in Mongoose is used to populate referenced documents? populate() aggregate() mapReduce() lean() 14 / 20 Which MongoDB index type is best suited for queries involving text search? Compound index Geospatial index Single-field index Text index 15 / 20 What is the purpose of the cluster module in Node.js? To manage database transactions To handle event-driven communication To create and manage child processes for concurrency To run multiple instances of Express.js 16 / 20 What is the purpose of useMemo() in React? To perform side effects in functional components To handle lifecycle methods To manage component state To memoize expensive calculations between renders 17 / 20 In Express.js, middleware functions have access to which of the following objects? req and res only req, res, and next res and next only req and next only 18 / 20 How do you update state based on the previous state in React? setState(newValue) setState((prevState) => newValue) setState({ ...prevState, newValue }) this.state = newValue 19 / 20 Which hook is used to handle side effects in functional components? useState() useReducer() useContext() useEffect() 20 / 20 In MongoDB, which aggregation stage is used to reshape documents, adding or removing fields? $project $match $sort $group Your score isThe average score is 46% 0%