curriculum/challenges/english/blocks/quiz-node-js-intro/6900a59dedf6c5c52824304f.md
To pass the quiz, you must correctly answer at least 9 of the 10 questions below.
Why does client-side JavaScript have restricted access to the local file system?
Because JavaScript is a slow programming language.
Because browsers do not have enough memory to handle files.
Because the DOM API prevents file access.
Because it was designed to run in web browsers where unrestricted file access would pose security risks.
What does it mean that Node.js is "cross-platform"?
It can run multiple programming languages simultaneously.
It can connect different databases together.
It requires different installation methods for each operating system.
It works on any operating system, including Windows, macOS, and Linux.
Which API is accessible in the browser environment but NOT in the Node.js environment?
The File System API
The Networking API
The Operating System API
The DOM API
What is npm in the context of Node.js?
A JavaScript framework for building user interfaces.
A web browser optimized for Node.js applications.
A debugging tool for Node.js applications.
A package manager for Node.js that allows you to install and manage packages and modules.
What does the --lts flag indicate when running nvm install --lts?
It installs the latest testing snapshot version.
It installs the lightest and smallest version available.
It installs the version with the most features.
It installs the Long-Term Support version that prioritizes stability, reliability, and security.
What is a "callback" in the context of asynchronous programming in Node.js?
A method that restarts a failed operation.
A variable that stores the result of synchronous operations.
A tool that monitors application performance.
A function that defines what happens when asynchronous operations are completed.
What is the purpose of the package.json file created by npm init?
To store environment variables for the application.
To configure the web server settings.
To define the HTML structure of the application.
To track the project's details and dependencies.
Why might CPU-intensive tasks be problematic in Node.js?
Node.js cannot perform mathematical operations.
Node.js does not support cryptography or image processing.
The event loop prevents CPU operations from running.
They may block the main thread since Node.js runs on a single thread, resulting in performance issues.
What command would you use to run a JavaScript file named server.js using Node.js?
npm run server.js
nvm execute server.js
javascript server.js
node server.js
What should developers check before choosing packages from npm?
Whether the package has at least 1000 downloads.
Whether the package was created recently.
Whether the package requires payment.
Whether the package is maintained and follows quality and security best practices.