Node Js Multiple Choice Question

Question 1. What is Node.js ?

  • A

    A server-side JavaScript runtime environment

  • B

    A front-end framework

  • C

    A database management system

  • D

    A programming language

Answer:
A

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

  • A

    fs

  • B

    http

  • C

    net

  • D

    mongo

Answer:
D

Question 3. What is the default package manager for Node.js ?

  • A

    npm

  • B

    yarn

  • C

    bower

  • D

    gulp

Answer:
A

Question 4. Which of the following methods is used to import modules in Node.js ?

  • A

    require()

  • B

    import ()

  • C

    include()

  • D

    import_module()

Answer:
A

Question 5. Which module is commonly used for creating a web server in Node.js ?

  • A

    http

  • B

    fs

  • C

    url

  • D

    path

Answer:
A

Question 6. Which keyword is used to create a new instance of an object in Node.js ?

  • A

    new

  • B

    instance

  • C

    create

  • D

    object

Answer:
A

Question 7. Which event is emitted when an error occurs in Node.js ?

  • A

    error

  • B

    exception

  • C

    fail

  • D

    crash

Answer:
A

Question 8. Which module is used for working with file operations in Node.js ?

  • A

    fs

  • B

    http

  • C

    net

  • D

    path

Answer:
A

Question 9. What is the purpose of the package.json file in Node.js ?

  • A

    To define project dependencies and configurations

  • B

    To store JavaScript code

  • C

    To define the HTML structure of a webpage

  • D

    To define database schemas

Answer:
A

Question 10. Which of the following is a non-blocking I/O model used in Node.js ?

  • A

    Synchronous I/O

  • B

    Asynchronous I/O

  • C

    Multi-threaded I/O

  • D

    Blocking I/O

Answer:
B