Your Page Title
🔍

    Node.js Quiz

    1. What is Node.js primarily used for?
    A. Styling web pages
    B. Creating mobile applications
    C. Designing user interfaces
    D. Running JavaScript on the server-side

      2. Which module in Node.js is used to create a web server?

      1. http
      2. path
      3. fs
      4. url

      3. What does npm stand for?

      1. Network Protocol Module
      2. Node Performance Monitor
      3. New Programming Method
      4. Node Package Manager

      4. Which of the following is true about the Node.js event loop?

      1. It blocks I/O operations
      2. It uses multiple threads for JavaScript execution
      3. It handles asynchronous operations using a single thread
      4. It is only used for debugging

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

      1. fs.writeFile()
      2. fs.open()
      3. fs.readFile()
      4. fs.readFileSync()

      6. Which object is used in Node.js to handle asynchronous events?

      • A) Callback
      • B) EventEmitter
      • C) Stream
      • D) Promise

      7. What does require() do in Node.js?

      • A) Makes HTTP requests
      • B) Loads and caches a module
      • C) Parses a JSON string
      • D) Initializes the server

      8.Which module is used to create a web server in Node.js?

      • A) url
      • B) events
      • C) http
      • D) express

      9.Which of the following is true about Node.js?

      • A) It is synchronous by default
      • B) It is built on Java’s V8 engine
      • C) It uses the V8 JavaScript engine
      • D) It supports multithreading by default

      10. Which function is used to read a file asynchronously in Node.js?

      • A) fs.readFileSync
      • B) fs.open
      • C) fs.readFile
      • D) fs.read

      11. How do you export a function in Node.js?

      • A) export function
      • B) module.exports = myFunction
      • C) exports: myFunction
      • D) define(myFunction)

      12. What does npm stand for?

      • A) Node Package Manager
      • B) Node Project Manager
      • C) New Programming Module
      • D) NodeJS Program Manager

      13. Which keyword is used to handle exceptions in Node.js?

      • A) throw
      • B) catch
      • C) try…catch
      • D) error

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

      • A) http.listen
      • B) server.listen
      • C) http.createServer
      • D) express.create

      15. Which of these is a third-party Node.js web framework?

      • A) http
      • B) fs
      • C) express
      • D) url

      16. What is the use of process in Node.js?

      • A) To start an HTTP server
      • B) To interact with OS processes
      • C) To import modules
      • D) To style HTML pages