Quiz about Node.js Basics

Node.js Basics

Last Updated :
Discuss
Comments

Question 1

What makes Node.js ideal for handling concurrent requests?

  • A

    Multi-threading model

  • B

    Blocking I/O operations

  • C

    Non-blocking, event-driven model

  • D

    In-built database

Question 2

How do you start the Node.js REPL environment?

  • A

    run repl

  • B

    start nodejs

  • C

    node

  • D

    npm start

Question 3

Which of the following is NOT a section inside package.json?

  • A

    dependencies

  • B

    devDependencies

  • C

    repositories

  • D

    engines

Question 4

Which of the following is used to start a Node.js HTTP server?

  • A

    http.create()

  • B

    http.listen()

  • C

    http.createServer()

  • D

    server.http()

Question 5

Which of these modules is NOT a core Node.js module?

  • A

    fs

  • B

    path

  • C

    express

  • D

    http

Question 6

What is the default port often used when creating a Node.js HTTP server in examples?

  • A

    80

  • B

    443

  • C

    3000

  • D

    8080

Question 7

Which of the following commands exits the Node.js REPL?

  • A

    .exit

  • B

    exit()

  • C

    stop

  • D

    quit

Question 8

Which built-in Node.js module is used for working with file operations?

  • A

    path


  • B

    fs

  • C

    os

  • D

    util

Question 9

What happens if "main" is missing in package.json?

  • A

    Node.js won’t run the project

  • B

    It defaults to index.js in the root folder

  • C

    It defaults to app.js

  • D

    An error is thrown during npm start

Question 10

If you define "type": "module" in package.json, what changes in Node.js?

  • A

    Node.js uses CommonJS by default

  • B

    Node.js treats .js files as ES modules

  • C

    Node.js requires .mjs extension

  • D

    Node.js blocks import/export

Tags:

There are 10 questions to complete.

Take a part in the ongoing discussion