Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
4 views2 pages

NodeJS Interview QA

The document provides a list of common Node.js interview questions and their answers, covering topics such as the definition of Node.js, its key features, differences from browser JavaScript, and the use of npm. It also explains concepts like the Event Loop, modules, callback functions, and the package.json file. This resource is useful for preparing for Node.js interviews by summarizing essential knowledge and terminology.

Uploaded by

bharwads479
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

NodeJS Interview QA

The document provides a list of common Node.js interview questions and their answers, covering topics such as the definition of Node.js, its key features, differences from browser JavaScript, and the use of npm. It also explains concepts like the Event Loop, modules, callback functions, and the package.json file. This resource is useful for preparing for Node.js interviews by summarizing essential knowledge and terminology.

Uploaded by

bharwads479
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Node.

js Interview Questions and Answers

1. What is Node.js?

Answer: Node.js is an open-source, cross-platform JavaScript runtime environment that executes

JavaScript code outside a web browser. It uses the V8 engine and is designed for building scalable

network applications.

2. What are the key features of Node.js?

Answer: - Asynchronous and Event-driven

- Very fast (V8 engine)

- Single-threaded but highly scalable

- No buffering

- Cross-platform

3. How is Node.js different from JavaScript in the browser?

Answer: Node.js runs JavaScript on the server-side, while browser JavaScript runs on the

client-side. Node provides APIs for file system, HTTP, etc., which are not available in the browser.

4. What is the use of npm?

Answer: npm (Node Package Manager) is used to manage dependencies (libraries and packages)

in Node.js projects.

5. What is the difference between npm and npx?

Answer: npm installs packages, while npx executes packages without installing them globally.

6. What is the Event Loop in Node.js?

Answer: The event loop is a mechanism that handles asynchronous callbacks. It allows Node.js to

perform non-blocking I/O operations despite being single-threaded.

7. What are modules in Node.js?


Answer: Modules are reusable blocks of code. Node.js has built-in modules (fs, http, etc.),

third-party modules (via npm), and custom modules.

8. How do you export and import a module in Node.js?

Answer: Use `module.exports = value` to export and `require('module')` to import.

9. What is a callback function?

Answer: A callback is a function passed into another function to be executed later, often after an

async task.

10. What is package.json?

Answer: It is a metadata file that includes details like project name, version, scripts, and

dependencies.

You might also like