Essential Node.js Concepts for Interviews Quiz

Test your understanding of Node.js fundamentals with this quiz covering key topics such as event-driven architecture, package management, async programming, and core modules. Ideal for interview preparation and Node.js beginners.

  1. Node.js Overview

    What is Node.js?

    1. A JavaScript runtime environment for executing code outside the browser
    2. A type of database engine
    3. An IDE for JavaScript
    4. A CSS preprocessor tool
  2. Event-Driven Architecture

    What does it mean when Node.js is described as 'event-driven'?

    1. It uses an event loop to manage asynchronous operations
    2. It executes code in random order
    3. It processes only synchronous code
    4. It handles tasks sequentially in a linear order
  3. V8 Engine Role

    Which of the following best describes the role of the V8 engine in Node.js?

    1. It compiles JavaScript code to machine code for fast execution
    2. It manages server hardware resources
    3. It provides a user interface for Node.js applications
    4. It handles network communication
  4. Non-Blocking I/O

    What is non-blocking I/O in Node.js useful for?

    1. Securing user passwords
    2. Slowing down server response times
    3. Allowing simultaneous handling of multiple requests
    4. Improving database storage capacity
  5. Node.js Modules

    Which is NOT a type of module in Node.js?

    1. External module
    2. Core module
    3. Local module
    4. Third-party module
  6. npm Usage

    What is the primary purpose of npm in a Node.js project?

    1. Encrypting server data
    2. Running database queries
    3. Creating HTML templates
    4. Managing and installing packages
  7. package.json Purpose

    What information is typically found in a project's package.json file?

    1. HTML layouts and CSS styles
    2. Server CPU usage statistics
    3. Database credentials and user passwords
    4. Project metadata, dependencies, and scripts
  8. Asynchronous Programming Methods

    Which of these is NOT a common method to handle asynchronous code in Node.js?

    1. Promises
    2. Async/await
    3. Callbacks
    4. Switch-case
  9. Callback Function

    What is a callback function in Node.js?

    1. A utility to compress files
    2. A function that is executed after an asynchronous task completes
    3. A property found only in JSON files
    4. A function that processes only HTTP requests
  10. Difference Between npm and yarn

    What is the main difference between npm and yarn?

    1. Both are package managers, but yarn focuses on speed and reliability
    2. npm is for back-end and yarn is for front-end only
    3. npm requires internet but yarn does not
    4. yarn only supports Python projects