The Backend (with Node.js)
- Question #41
- Question #42
- Question #43
- Question #44
- Question #45
- Question #46
- Question #47
- Question #48
- Question #49
- Question #50
- Question #51
- Question #52
- Question #53
- Question #54
- Question #55
- Question #56
- Question #57
- Question #58
- Question #59
- Question #60
- Question #61
- Question #62
- Question #63
- Question #64
- Question #65
- Question #66
- Question #67
- Question #68
- Question #69
- Question #70
- Question #71
- Question #72
- Question #73
- Question #74
- Question #75
- Question #76
- Question #77
- Question #78
- Question #79
Question #41
A) To emphasize the idea that a Node.js application should comprise multiple small distributed nodes that communicate with each other
B) A Node.js application automatically creates many forks to replace the concept of threads. These forks are known as "nodes"
C) Node.js ships with many built-in modules that are also known as "nodes"
D) Node.js is designed to work with the Operating Systems inodes.
Question #42
A) The libuv library
B) The VM (like V8 or Chakra)
C) The c-ares library
D) The repl module
Question #43
A) You can’t.
B) You can measure the time the whole script takes and then use the delays of the timers to estimate how much time each one took
C) You can use NODE_DEBUG=timers
to accomplish that
D) You can use the -r
CLI option to load a script that overrides the definitions of the timers API functions.
Question #44
A) crpyto
B) cluster
C) openssl
D) events
Question #45
A) string_decoder
B) string_buffer
C) buffer
D) util
Question #46
A) A method that does not place any read-locks on files in the file system
B) A method that executes asynchronously
C) A method that executes synchronously
D) A method that does not block the execution of previous lines of code
Question #47
A) Every Node process runs in a single thread and all the I/O work is run in that same thread
B) JavaScript execution in Node.js is single-threaded but I/O operations are executed using multiple threads
C) Every Node process gets 4 threads that it can share between its JavaScript VM and the event loop
D) The event loop is single-threaded but a JavaScript VM can use multiple threads
Question #48
A) c-ares
B) V8
C) libuv
D) events
Question #49
A) Local .modules
folder
B) Local node_modules
folder then parents' node_modules
folders
C) The .modules
folder under the home directory
D) A something.js
or a something folder that exists on the same level as the requiring file
Question #50
A) net
B) ftp
C) https
D) http2
Question #51
A) exports
B) setTimeout
C) process
D) Buffer
Question #52
A) The Events Queue
B) The Call Stack
C) The Poll Phase
D) The Event Loop
Question #53
A) -r
B) -e
C) -p
D) -c
Question #54
A) You can use the V8 option --use-strict
B) You have to use an external tool for that
C) Only if you are using ES modules
D) Only if you are using Chakra as the VM
Question #55
A) .history
B) .break
C) .editor
D) .save
Question #56
A) v8
B) process
C) child_process
D) env
Question #57
A) Buffer
B) process
C) require
D) root
Question #58
A) quit
B) crash
C) uncaughtException
D) error
Question #59
A) process.stdout
B) process.stdinfo
C) process.stdin
D) process.stderr
Question #60
A) Changes are not backward compatible
B) Changes are just bug fixes and no new features were added
C) Changes will add new functionalities but will not break any existing code
D) Changes might not be backward compatible and might break existing code
Question #61
A) A JavaScript file can have a .node
extension as well as the .js
extension
B) A C++ addon file that is built with node-gyp and requirable in Node
C) A C++ file can have a .node
extension and Node will be able to execute that file directly
Question #62
A) ReferenceError: arguments is not defined
B) undefined
C) An empty string
D) An object representing an array that has 5 elements
Question #63
A) "require" works for local files and modules while "import" only works for modules
B) "require" is dynamically evaluated while "import" is statically evaluated
C) "require" is statically evaluated while "import" is dynamically evaluated
D) There is no difference. Both do the exact same thing.
Question #64
A) By executing every operation in its own thread
B) By forking a process for every operation
C) Using the Event Loop
D) Using the Call Stack
Question #65
A) The Event Loop has 4 queues of callbacks to execute
B) The Event Loop has one queue for its own threads, and another queue for the OS threads
C) Each of the Event Loop phases has a queue of callbacks to execute
D) The Event Loop works with a single queue of callbacks to execute
Question #66
A) Event emitters can be "promisified" while callbacks can’t
B) Event emitters have a higher priority over single callbacks
C) Event emitters do not have the nested callback problem
D) With event emitters, you can define multiple handlers to work with an asynchronous result
Question #67
A) util.promisify(child_process.exec())
B) new Promise(child_process.exec)
C) new Promise(child_process.exec())
D) util.promisify(child_process.exec)
Question #68
A)
const x = require('x')(); x.value;
B)
const x = require('x'); x.next();
C)
const x = require('x')(); x.next;
D)
const x = require('x'); x.value();
Question #69
A) EventEmitter.new().emit('CHANGE');
B) EventEmitter.emit('CHANGE');
C) new EventEmitter('CHANGE');
D) (new EventEmitter()).emit('CHANGE');
Question #70
A)
const requestListener = (req, res) => { x.pipe(res); };
B)
const requestListener = (req, res) => { res.pipe(x); };
C)
const requestListener = (req, res) => { res.send(x); };
D)
const requestListener = (req, res) => { res.write(x); };
Question #71
A) process.stdout
B) Buffer
C) process.uptime
D) process
Question #72
A) readableSrc.on('pipe', writableDest)
B) wrtibaleDest.on('pipe', readableSrc)
C) wrtibaleDest.pipe(readableSrc)
D) readableSrc.pipe(writableDest)
Question #73
A) spawn("ps -ef")
B) exec("ps", "-ef")
C) exec("ps -ef")
D) fork("ps -ef")
Question #74
A) The forked process will have its own VM instance
B) The forked process shares the event loop with the parent process
C) A new VM instance is created and the two VM instances will be shared between the forked process and the parent process
D) The forked process shares the same VM thread with the parent process
Question #75
A) net
B) os
C) util
D) cluster
Question #76
A) assert
B) jest
C) mocha
D) chai
Question #77
A) Compression functionality implemented using Gzip, Deflate/Inflate.
B) Logging functionality for middleware
C) Bindings for working with HTML5 websockets
D) An easier to use API wrapping OpenSSL
Question #78
A) v8
B) vm
C) sandbox
D) exec
Question #79
A) crpyto
B) webpack
C) request
D) chalk