Home / Interview / Node.js :: General Questions

Interview :: Node.js

11) Does Node.js provide Debugger?

Yes, Node.js provides a simple TCP based protocol and built-in debugging client. For debugging your JavaScript file, you can use debug argument followed by the js file name you want to debug.

Syntax:

12) What is a control flow function?

Control flow function is a generic piece of code that runs in between several asynchronous function calls.

13) How "Control Flow" controls the functions calls?

The control flow does the following job:

  • Control the order of execution
  • Collect data
  • Limit concurrency
  • Call the next step in a program
14) Is it possible to access DOM in Node?

No, it is not possible to access DOM in Node.

15) What types of tasks can be done asynchronously using the event loop?
  • I/O operations
  • Heavy computation
  • Anything requiring blocking
16) What is REPL in Node.js?

REPL stands for Read Eval Print Loop. It specifies a computer environment like a window console or Unix/Linux shell where you can enter a command, and the computer responds with an output.

REPL environment incorporates with Node.js.

17) Explain the tasks of terms used in Node REPL.

Following are the terms used in REPL with their defined tasks:

Read: It reads user's input; parse the input into JavaScript data-structure and stores in memory.

Eval: It takes and evaluates the data structure.

Print: It is used to print the result.

Loop: It loops the above command until user press ctrl-c twice to terminate.

18) Is it possible to evaluate simple expressions using Node REPL?

Yes. You can evaluate simple expressions using Node REPL.

19) What is the use of the underscore variable in REPL?

In REPL, the underscore variable is used to get the last result.

20) Does Node.js supports cryptography?

Yes, Node.js Crypto module supports cryptography. It provides cryptographic functionality that includes a set of wrappers for open SSL's hash HMAC, cipher, decipher, sign and verify functions. For example: