NodeJS Interview Prep

NodeJS Interview Prep

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

NodeJS uses a single threaded (partially true), event-driven, non-blocking I/O model that makes it lightweight and efficient, what does this mean?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (6)

Section 1

(6 cards)

NodeJS uses a single threaded (partially true), event-driven, non-blocking I/O model that makes it lightweight and efficient, what does this mean?

Front

I/O refers to input/output. It can be anything ranging from reading/writing local files to making an HTTP request to an API. Single threaded event loop refers to the call stack which executes one operation at a time by popping calls from the stack. Event driven refers to the fact that everything that happens in NodeJS is a response to an action. Non-blocking I/O means that it can make multiple requests asynchronously and does not need to wait for one to return before initiating the next. (This part requires multiple threads). When an asynchronous call reaches the call stack, it gets popped and then waits to complete, upon completion it enters the callback queue and is unshifted back on to the call stack once all other processes have been popped.

Back

What is the HTTP module for?

Front

It allows Node to transfer data over HTTP. It can create a HTTP server that listens to server ports and gives a response back to the client.

Back

What does the URL module do?

Front

The URL module splits up a web address into readable parts.

Back

How do you write a server in Node?

Front

var http = require('http'); http.createServer(function(req, res) { ... }).listen(8080);

Back

What did NodeJS accomplish?

Front

It allowed developers to run JS on a machine rather than just in a browser.

Back

NodeJS is a runtime built on Chrome's v8 JS engine, what does this mean?

Front

NodeJS runs on the V8 JS runtime engine. This engine takes your JS code and converts it into a faster low level machine code in which the cpu doesn't need to interpret it first.

Back