Online Exam Quiz

questionQuestion  1 to 30

Which of the following is not a core module in Node.js?

  • http
  • fs
  • express
  • path
Mark for review

How can you create a route in Express?

  • app.route()
  • app.get()
  • app.post()
  • All of the above
Mark for review

What is the use of 'cors' middleware in Express?

  • To handle cookies
  • To enable Cross-Origin Resource Sharing
  • To manage sessions
  • To parse form data
Mark for review

What is the purpose of 'package.json'?

  • To manage project dependencies
  • To configure the database
  • To handle HTTP requests
  • To serve static files
Mark for review

Which method is used to read a file in Node.js?

  • fs.read()
  • fs.readFile()
  • fs.readFileSync()
  • Both fs.readFile() and fs.readFileSync()
Mark for review

How can you handle file uploads in Express?

  • Using 'body-parser'
  • Using 'express-fileupload'
  • Using 'fs' module
  • Using 'multer'
Mark for review

Which of the following is true about Node.js?

  • It is synchronous by default
  • It is asynchronous by default
  • It does not support I/O operations
  • It cannot be used for web applications
Mark for review

How can you handle exceptions in Node.js?

  • try-catch block
  • error handling block
  • exception block
  • handle block
Mark for review

How can you create a buffer in Node.js?

  • Buffer.alloc()
  • Buffer.create()
  • new Buffer()
  • Both Buffer.alloc() and new Buffer()
Mark for review

Which of the following is a database that can be used with Node.js?

  • MySQL
  • MongoDB
  • PostgreSQL
  • All of the above
Mark for review

Which method is used to parse JSON data in Node.js?

  • JSON.parse()
  • JSON.stringify()
  • JSON.toString()
  • JSON.convert()
Mark for review

What does the 'path' module provide?

  • A way to handle file paths
  • HTTP server functionality
  • Cryptographic functions
  • Database access
Mark for review

What is 'async/await' used for in Node.js?

  • To handle synchronous code
  • To handle asynchronous code
  • To create a server
  • To read files
Mark for review

Which function is used to include modules in Node.js?

  • import
  • include
  • require
  • get
Mark for review

How do you install a package globally using npm?

  • npm install package
  • npm install package -g
  • npm global install package
  • npm add package
Mark for review

What is the purpose of the 'app.listen()' function in Express?

  • To create a server
  • To start listening for connections
  • To handle GET requests
  • To handle POST requests
Mark for review

How do you export a function in Node.js?

  • module.exports = myFunction
  • exports.myFunction = myFunction
  • export myFunction
  • Both module.exports = myFunction and exports.myFunction = myFunction
Mark for review

How can you connect to a MongoDB database in Node.js?

  • Using 'mysql' module
  • Using 'mongodb' module
  • Using 'sequelize' module
  • Using 'pg' module
Mark for review

What does 'process.exit()' do in Node.js?

  • Ends the process
  • Starts a new process
  • Restarts the process
  • Pauses the process
Mark for review

How do you serve static files in Express?

  • app.static()
  • express.static()
  • app.serve()
  • express.serve()
Mark for review

Which of the following is used to make HTTP requests in Node.js?

  • http
  • axios
  • request
  • All of the above
Mark for review

What is 'body-parser' used for in Express?

  • To parse incoming request bodies
  • To handle cookies
  • To manage sessions
  • To serve static files
Mark for review

What does the 'req.query' object contain in Express?

  • Query string parameters
  • Route parameters
  • Header information
  • Cookie data
Mark for review

How can you create a promise in Node.js?

  • new Promise()
  • Promise.create()
  • createPromise()
  • promise()
Mark for review

What is the purpose of the 'next' parameter in Express middleware?

  • To handle the next request
  • To pass control to the next middleware function
  • To end the response
  • To start a new session
Mark for review

Which command is used to uninstall a package using npm?

  • npm delete package
  • npm remove package
  • npm uninstall package
  • npm unpackage
Mark for review

What is Node.js?

  • A runtime environment
  • A library
  • A framework
  • A database
Mark for review

What does 'process.env' contain?

  • Environment variables
  • Event loop status
  • Process status
  • File system paths
Mark for review

What does the 'req.params' object contain in Express?

  • Route parameters
  • Query parameters
  • Header information
  • Cookie data
Mark for review

What is npm?

  • Node Programming Method
  • Node Package Manager
  • New Programming Module
  • None of the above
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review