Trigonometry

Question Bank

Trigonometry

By Testr

MAthamatics

  • Mathematics

Questions - Page 2

  1. Node.js code executes in a single thread, implying no concurrency is possible.

    true false · medium · 0 Marks

    • True
    • False

    Answer: False

  2. Which HTTP module method is used to create an HTTP server in Node.js?

    single choice · medium · 0 Marks

    • `http.initServer()`
    • `http.createServer()`
    • `http.newServer()`
    • `http.start()`

    Answer: `http.createServer()`

  3. The `fs.readFile` method is an asynchronous operation by default.

    true false · medium · 0 Marks

    • True
    • False

    Answer: True

  4. What is a 'Middleware' in the context of Express.js?

    single choice · medium · 0 Marks

    • A type of database driver
    • Functions that execute during the request-response cycle and have access to the req and res objects
    • A specialized caching engine
    • A command-line tool for scaffolding projects

    Answer: Functions that execute during the request-response cycle and have access to the req and res objects

  5. `global` object in Node.js is similar to `window` in the browser environment.

    true false · medium · 0 Marks

    • True
    • False

    Answer: True

  6. Which file is the default entry point for a Node.js application if not specified in package.json?

    single choice · medium · 0 Marks

    • index.html
    • app.js
    • index.js
    • main.js

    Answer: index.js

  7. Node.js streams are instances of the `EventEmitter` class.

    true false · medium · 0 Marks

    • True
    • False

    Answer: True

  8. Which of these modules is NOT a built-in Node.js module?

    single choice · medium · 0 Marks

    • `fs`
    • `path`
    • `express`
    • `http`

    Answer: `express`

  9. Using `try-catch` blocks is sufficient to catch all errors in asynchronous Node.js code.

    true false · medium · 0 Marks

    • True
    • False

    Answer: False

  10. What is the purpose of the `__dirname` global variable in Node.js?

    single choice · medium · 0 Marks

    • It contains the name of the current file
    • It stores the absolute path to the directory containing the currently executing file
    • It provides the path to the node executable
    • It specifies the current working directory from which the process was started

    Answer: It stores the absolute path to the directory containing the currently executing file