NodeJs Interview Questions

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Benefits of NodeJS

1. fast execution 2. uses async programming 3. highly scalable 4. free and open-source 5. outputs data in chunks with no buffer

What is the purpose of module.exports?

A module encapsulates code into a single unit. the exports method exposes the code allowing other modules/files to import it.

What is event driven programming?

An application is based on and responds to events.

What is NodeJS?

An event-driven, single-threaded, asynchronous framework

Difference between async and non-blocking.

Async means that the application does not wait for the server response. It continues executing blocks of code and will respond to the response when received. Non-blocking means calling thread will wait until it has some data.

What is the difference between Javascript and NodeJS?

JS is a programming language and NodeJS is an interpreter and server environment FOR Javascript.

What is NPM?

NPM is the Node package manager (package ecosystem for Node). It is a central library that anyone can access and install packages from.

What type of applications are good for NodeJS?

Networking and CRUD based apps, streaming apps and IoT(like Netflix), but it is not good for CPU intensive apps (like the SIMS)

What is the event loop?

The event loop handles all async callbacks. When an event fires, a listener executes the callback. The event loop executes the callbacks in the queue one-by-one.

How does NodeJS work?

The single thread executes frunctions in queue on an event loop. It can handle simultaneous requests.

What is package.json?

This file has metadata about the application and handles dependencies. Gives info to NPM.

How do you debug?

Using the debugger statement allows for this.

What is ExpressJS?

a lightweight framework for Node.js. It provides features for web and mobile apps.

Difference between setImmediate and setTimeout.

setImmediate executes code once event loop phase completes. setTimeout schedules code to execute after a certain time period.


Set pelajaran terkait

DTR Domain II (34%) - Nutrition Care for Individuals and Groups

View Set

Chapter 1 NCLEX Questions + Prequiz

View Set

Ch 8. Assess: General Status and Vital Signs

View Set

Arkansas Health Insurance Study Questions

View Set

Chapter 16 - Inventory and Operations Management

View Set