Online Exam Quiz

questionQuestion  1 to 30

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

  • util
  • express
  • events
  • http
Mark for review

Which Node.js method is used to handle asynchronous operations?

  • sync()
  • await()
  • async()
  • callback()
Mark for review

What does the os module provide in Node.js?

  • Methods for handling file system operations
  • Methods for interacting with the operating system
  • Methods for parsing URLs
  • Methods for handling HTTP requests and responses
Mark for review

How do you handle form data in Node.js?

  • Using the formdata module
  • Using the body-parser middleware
  • Using the express framework
  • Using the express framework
Mark for review

What is the purpose of the util module in Node.js?

  • To perform mathematical operations
  • To handle file system operations
  • To provide utility functions
  • To create web servers
Mark for review

Which method is used to execute shell commands in Node.js?

  • child_process.exec()
  • child_process.spawn()
  • child_process.fork()
  • child_process.shell()
Mark for review

Which method is used to remove a directory in Node.js?

  • fs.deleteDir()
  • fs.removeDir()
  • fs.rmdir()
  • fs.unlink()
Mark for review

Which command is used to start a Node.js REPL session?

  • start
  • node start
  • node
  • run
Mark for review

How do you handle file uploads in Node.js?

  • Using the http module
  • Using the fs module
  • Using the express framework
  • All of the above
Mark for review

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

  • fs.rename()
  • fs.move()
  • fs.relocate()
  • fs.rewrite()
Mark for review

What is the purpose of the child_process module in Node.js?

  • To handle child processes
  • To interact with the file system
  • To create HTTP servers
  • To manipulate arrays
Mark for review

Which of the following is a built-in HTTP module in Node.js?

  • request
  • fetch
  • http
  • axios
Mark for review

How do you handle cookies in Node.js?

  • Using the cookie-parser middleware
  • Using the cookies module
  • Using the express framework
  • All of the above
Mark for review

What does the EventEmitter class do in Node.js?

  • Emits events asynchronously
  • Handles HTTP requests
  • Provides encryption functions
  • Converts callback functions to promises
Mark for review

How do you handle sessions in Node.js?

  • Using the express-session middleware
  • Using the session module
  • Using the cookie-parser middleware
  • All of the above
Mark for review

What is npm in Node.js?

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

Which module is used to handle file system operations in Node.js?

  • fs
  • path
  • os
  • util
Mark for review

Which of the following is NOT a built-in module in Node.js?

  • fs
  • http
  • express
  • os
Mark for review

What is the purpose of the crypto module in Node.js?

  • To handle cryptographic functions
  • To manipulate arrays
  • To create child processes
  • To handle file system operations
Mark for review

How do you create a child process in Node.js?

  • Using the fork() method
  • Using the exec() method
  • Using the spawn() method
  • All of the above
Mark for review

How do you delete a file in Node.js?

  • Using the fs.delete() method
  • Using the fs.unlink() method
  • Using the fs.remove() method
  • Using the fs.deleteFile() method
Mark for review

What does the http.createServer() method return in Node.js?

  • An HTTP request object
  • An HTTP response object
  • An HTTP server object
  • An HTTP client object
Mark for review

What is Node.js?

  • A web browser
  • A server-side JavaScript runtime
  • A front-end framework
  • A database management system
Mark for review

How can you install a Node.js package globally?

  • Using npm install -g <package-name>
  • Using npm install --global <package-name>
  • Using npm install --g <package-name>
  • Using npm global install <package-name>
Mark for review

What does the __dirname variable represent in Node.js?

  • The current file's directory
  • The root directory of the project
  • The parent directory of the current file
  • The home directory of the user
Mark for review

Which method is used to create a directory in Node.js?

  • fs.mkdir()
  • fs.createDir()
  • fs.newDir()
  • fs.makeDir()
Mark for review

Which module is used to parse JSON strings in Node.js?

  • url
  • querystring
  • json
  • None of the above
Mark for review

What is the purpose of the path module in Node.js?

  • To handle HTTP requests and responses
  • To manipulate file paths
  • To handle file uploads
  • To create child processes
Mark for review

Which HTTP method is used to retrieve data from the server in Node.js?

  • GET
  • POST
  • PUT
  • DELETE
Mark for review

What does the url.parse() method do in Node.js?

  • Parses URL strings into URL objects
  • Parses query strings into key-value pairs
  • Parses JSON strings into JavaScript objects
  • 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