• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/31

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

31 Cards in this Set

  • Front
  • Back
What is Node.js
Node is a server side JS based platform, that is run outside of the browser, and is used to develop I/O intensive web apps
How Node.js works
Node.js works on a v8 environment, it is a virtual machine that utilizes JavaScript as its scripting language and achieves high output via non-blocking I/O and single threaded event loop.
What do you mean by the term I/O
I/O is the shorthand for input and output, and it will access anything outside of your application. It will be loaded into the machine memory to run the program, once the application is started.
What does event-driven programming mean
In an event-driven application, there is generally a main loop that listens for events, and then triggers a callback function when one of those events is detected. In computer programming, event driven programming is a programming paradigm in which the flow of the program is determined by events like messages from other programs or threads. It is an application architecture technique divided into two sections 1) Event Selection 2) Event Handling
Advantages of Node.js
Fast, Asynchronous, almost never blocks, easy way to scale network programs
Two types of API functions in Node.js
Asynchronous, non-blocking functions and Synchronous, blocking functions
Node.js vs Ajax
The difference between Node.js and Ajax is that, Ajax (short for Asynchronous Javascript and XML) is a client side technology, often used for updating the contents of the page without refreshing it. While,Node.js is Server Side Javascript, used for developing server software. Node.js does not execute in the browser but by the server.
What node.js command is used to import external libraries
require
Most common framework used in Node.js
Express
What is a callback
Callback is called once the asynchronous operation has been completed. Node.js heavily uses callbacks and all API’s of Node.js are written to support callbacks.
What does REPL stand for
REPL stands for Read Eval Print Loop. Node.js comes with bundled REPL environment
Explain variables in Node.js
Variables are used to store values and print later like any conventional scripts. If “var” keyword is used then value is stored in variable.
What is NPM
NPM stands for Node Package Manager (npm) and there are two functionalities which NPM takes care of mainly and they are 1. Online repositories for node.js modules or packages, which can be searched on search.nodejs.org 2. Dependency Management, Version Management and command line utility for installing Node.js packages.
How can Node.js be made more scalable
Node.js works good for I/O bound and not CPU bound work. For instance if there is a function to read a file, file reading will be started during that instruction and then it moves onto next instruction and once the I/O is done or completed it will call the callback function. So there will not be any blocking.
Explain Package.json
This will be present in the root directory of any Node module/application and will be used to define the properties of a package.
What is callback hell
“Callback hell” will be referred to heavily nested callbacks which has become unreadable or unwieldly.
What are streams in Node.js
“Streams” are objects which will let you read the data from source and write data to destination as a continuous process.
What is chaining in Node.js
It’s a mechanism in which output of one stream will be connected to another stream and thus creating a chain of multiple stream operations.
Explain Piping Stream in Node.js
This is a mechanism of connecting one stream to other and this is basically used for getting the data from one stream and pass the output of this to other stream.
Explain Console in Node.js
“Console” is a global object and will be used for printing to stderr and stdout and this will be used in synchronous manner in case of destination is either file or terminal or else it is used in asynchronous manner when it is a pipe.
Explain FS module
Here FS stands for “File System” and fs module is used for File I/O.
Explain – “console.log([data][, ...])” statement in Node.JS?
This statement is used for printing to “stdout” with newline and this function takes multiple arguments as “printf()”.
What is a Node.js "process"
“process” is a global object and will be used to represent a node process.
What are some exit codes in Node.js
Exit codes will be used when the process needs to be ended with specified code. Ex. Fatal Error, Unused, Uncaught Fatal Exception, Non-function Internal exception handler
Some properties of a node.js "process"
Platform, Stdin, stdout, execPath, stderr, arch, config, version, argv, exitcode
Explain "path" module in Node.js
“Path” module will be used for transforming and handling file paths
What is an error-first callback
Error-first callbacks are used to pass errors and data. The first argument is always an error object that the programmer has to check if something went wrong. Additional arguments are used to pass data.
In node.js what is the event loop
in Node you have C++ APIs that run your asynchronous functions in other threads and the event loop looks in the task queue to see if there are any asynchronous tasks that have been completed, if so it pushes it onto the call stack to be executed. In Chome, you have web apis that do the asynchronous functions in other threads
How does Node.js handle child threads
Node.js, in its essence, is a single thread process. It does not expose child threads and thread management methods to the developer. Technically, Node.js does spawn child threads for certain tasks such as asynchronous I/O, but these run behind the scenes and do not execute any application JavaScript code, nor block the main event loop.
Preferred method of handling unhandled exceptions
Unhandled exceptions in Node.js can be caught at the Process level by attaching a handler for uncaughtException event.
How does Node.js support multi-processor platforms, and does it fully utilize all processor resources?
Since Node.js is by default a single thread application, it will run on a single processor core and will not take full advantage of multiple core resources. However, Node.js provides support for deployment on multiple-core systems, to take greater advantage of the hardware. The Cluster module is one of the core Node.js modules and it allows running multiple Node.js worker processes that will share the same port.