1. What program is used to programmtically control the browser?
2. net.Server emits an event every time a ____ connects to the server.
3. If you have a problem with your code, where would you look?
4. If you have a node program called example.js, how would that be excuted?
5. REPL is:
6. To declare a variable use what keyword?
7. The 'js' in Node.js stands for?
8. Which is a comment in node?
9. How do you require a module?
10. NPM is a...
11. How do you output to console in node.js?
12. A module is an____?
13. What is node.js based on?
14. What is a Buffer?
15. WebSockets with Socket.io can be used to?
16. Which of the following can be created and managed using node.js?
17. Node.js is stored on your____?
18. True or False: node.js can call other command line scripts.
19. In node.js you can write and run code in what language?
20. Why is Node.js important?
21. A popular web application for framework for node?
22. How does one get access to Node.js?
23. Which of the following command-line arguments to 'npm install' will allow a module to be installed outside the project folder?
24. What Javascript Engine does node.js use?
25. What does 'npm' stand for?
26. What does Node.js run on?
27. How do you call a function attached to an object that will be executed when the object emits an event?
28. What kind of application is better suited to node.js?
29. Use _____ to step through your code.
30. What is the code to access the DNS module?
31. In this code: function myLog(err, data) { console.log(err, data); } fs.readFile('/tmp/sample', myLog); The function 'myLog' is used as a(an):
32. What interface is used to access folders on your local drive
33. What function is used to write out application errors/events?
34. Which is of the following is a potential advantage of using Node.js?
35. Which npm command will load all dependencies in the local node_modules folder?
36. node.js excels at dealing with:
37. Running the following code, what will the console output? var http = require('http'); http.createServer( function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.end('Hello World\n'); } ).listen(8000); console.log('Server running at http://localhost:8000/');
38. What does the require call return?
39. In the following Express route stack, which handler will be called for 'GET /item/23'? app.get('/', routes.index ); app.get('/item', routes.item ); app.get('/item/:id', routes.id ); app.post('/item/:id', routes.post );
40. How do you cause a function to be invoked at a specified time later?
41. Where does Node run on your machine?
42. What is REPL?
43. What method is used to parse JSON using NodeJS?
44. What interface is used to create a server through Node.js
45. What is node.js?
46. How can I call an object function from my module if my module name is 'iModule'?
47. True or False: node.js runs in a single thread.
48. What does the Zlib module provide?
49. Which of these is a built-in module that can be used for unit testing in Node.js?
50. Timer functions are built into node.js, you do not need to require() this module in order to use them.
51. How do you start the node.js REPL?
52. The interactive shell is also called_____?
53. The Cryptography module requires OpenSSL.
54. What syntax is correct for reading environment variable?
55. Which of the following is a standard node module, included with the default install?
56. Which function allows you to chain event listeners?
57. What is typically the first parameter in node.js callback functions?
58. Which of these statements about Express is true?
59. If an error occures in an Express middleware function, what is the best way to pass the error object to the subsequent handlers?
60. To exit out of a function you should use _____?
61. What do the lines like symbols = symbols || SYMBOLS_DEFAULT; do?
62. To create an instance of the HTTP object, which function is used?
63. Which company manages and maintains node.js?
64. The first argument passed to a Node.js asynchronous callback is always what?
65. Given the following route and request, which Request object property will hold the value of 30 in the Express handler? Route: '/post/:id' Request: '/post/30?start=20'
66. What built in class is a global type for dealing with binary data directly?
67. By executing node without any arguments from the command-line:
68. In Express, which of these Response methods can NOT automatically end the response?
69. Which of these Express middleware stacks will NOT log favicon requests?
70. How to delete a file in node.js?
71. The process object is an instance of what class?
72. Express middleware is actually handled by what other Node.js module?
73. Which of the following methods will print to the console without a trailing new line?
74. The VM module allows one to:
75. Node will run until its sure that no further ___ are available.
76. True or false? Node.js is multi-core by nature.
77. Which of the following statements are true about the module.exports object?
78. Node.js is a truly parallel technology.
79. Given the following route and request, which Request object property will hold the value of 20 in the Express handler? Route: '/post/:id' Request: '/post/30?start=20'
80. The process object is an instance of____?
81. Is it possible to use jQuery on Node.js?
82. var http_server = require('http'); how can you create a server?
83. Which of these is definitely true of Node.js?
84. What command is used to end a Node.JS process?
85. Node.js clusters are child processes that do NOT share server ports?
86. What is NOT a valid method to create a child process instance?
87. In Node.js, the result of an asynchronous function can be accessed how?
88. If an EventEmitter object emits an 'error' event and there is no listener for it, node will:
89. The Javascript used in node.js:
90. To parse a URL string use____?
91. What is the name of the module system used in node.js?
92. Which of these are required fields in your package.json file?
93. Which Express middleware must come before express.session() in your stack?
94. The http.ServerResponse is an example of a what?
95. Which of the following is not a global object in node.js?
96. What would be the value after that the timeouts has been fired? var x = 0; function callback(err,result){ if (err) { x--; return; } x++; } setTimeout(callback,10); setTimeout(callback,10,'Error');
97. In Express, which of these would NOT expose the variable 'title' to the template renderer?
98. Which of these is NOT a global object?
99. Which of these is a valid way to output the contents of a file?
100. Which express 3 middleware has _NOT_ been moved into its own module in express 4.
101. If the Connect node package module is updated from version 2.8.5 to version 3.1.0 which dependency in your package.json file may break your application on update?
102. How do you properly timestamp a log message?
103. In the following Express routing method, what is the maximum number of arguments that may be passed to the callback function 'routeHandler'? app.all('*', routeHandler )
104. When creating a command line tool with Node.js, which expresion will allow you access the first command line argument?
105. How do you create a new client connection via SSL?
106. Is it possible to execute node.js system command synchronously?
107. What is the default memory limit on a node process?
108. What is the default request limit to the same origin on a node.js http client?
109. Which of these is not a valid version according to npm semantic versioning?
110. Which of the following is NOT true about Node 0.6?
111. A Buffer can be resized.
112. Which is a correct way to check the latest released version of the Express module with npm?
113. Which of these are valid ways to apply middleware in Express?
114. Which node module is used to make API request?
115. Which of the following will copy a file in Node.js?
116. What does the following command do? npm view version
117. Which of the following statements is true about the process object in Node.js?
118. What does process.argv[1] contain?
119. Which of the following console commands will update all installed global packages to the latest available versions?
120. Which of the following will synchronously check if a file/directory exists?
121. Which of the following will open a file, then read its contents one line at a time?
122. Which of the following will open a file, then read its contents one line at a time?
123. Which of the following statements are true about the module.exports object in Node.js?
124. Which of the following statements are true about the child_process module in Node.js?
125. Which of the following methods can be used to read the contents of a directory?
126. Which of the following statements is true about the console Object in Node.js?
127. What does the following code do? var http = require('http'); var fs = require('fs'); var file = fs.createWriteStream('file.png'); var request = http.get('http://path/to/file.png', function(response) { response.pipe(file); });
128. Which Node.js module can be used to get the IP address of the server the program is running on?
129. Which of the following command-line arguments to'npm install' will allow an NPM package's binaries to be run outside the project folder?
130. Which of the following flags working with npm?
131. Suppose we have this construction in Expres.js project,Which of the following paths will match this route? app.get('/kl+mn', function(req, res) { return res.send('kl+mn'); });
132. What is the use of Underscore variable in REPL session?
133. You are handling POST request to the server. Which express middleware gives access to the submitted form data?
134. Which of the following files using for setting start point in deployment services?
135. Which of the following ways to create a child process?
136. Route path: /train/from-:to Request URL: http://localhost:3000/train/AHM-BRD What should be request params?
137. Which of the following file extensions supports Node Module System ?
138. NodeJS includes a full-featured out-of-process debugging utility accessible via a which protocol?
139. What REST stands for?
140. Which of the following statement is true about the fs module of Node?
141. Which of the following values can return async functions?
142. How would you start node with debugger?
143. Which of the following libs is using for debugging node-applications?
144. How to enabled V8 inspector for debug?
145. Which of the following libs provides basic HTTP authentication for protecting data?
146. Which of the following commands exit from REPL?
147. Which of the following values is correct about how many lines defaults can be in NODE_REPL_HISTORY_SIZE?
148. Which of the following module require to create server for NodeJS?
149. Which of the following engine built of NodeJS framework/platform?
150. Which are the below NodeJS features?
151. Which of the following code print the name of operating system?
152. Which of the libs are exists in Node Core Libraries?
153. Which of the following provides in-built events?
154. Which of the following classes is the parent for repl.REPLServer class?
155. Which of the following variables you can use in modules?
156. Which of the following timers methods exists in Node.js?
157. Which of the following is the result of module.id ?
158. Which of the following should not to use in NodeJS?
159. In express application you are handling the route '/user/:name'. How could you access the 'name' property?
160. Which of the following is operates asynchronous logic?
161. Which of the following code is valid to get a joint path?
162. Which of the following statement is valid?
163. Which of the following is not a HTTP method?
164. How to Terminate Node REPL using the following short key?
165. Which of the following methods is used to check modifications in files?
166. Which of the following utility modules are available in NodeJS?
167. Which command will show all the modules installed locally?
168. Which of the following frameworks is most popular Node.js framework?
169. Which of the following methods will write 'text' without a trailing new line?
170.
The NODE_DEBUG environment variable specifically turns logs for the following core functionality?
171. Which of the following can be used to access the environment variable?
172. Which of the following code prints current directory?
173. How can the output of one stream be provided as input to another stream?
174. In which of the following areas, Node.js is not advised to be used?
175. Which of the following NPM commands will install both dependencies and devDependencies of a given project?
176. How to add a listener to event emitter?
177. Which of the following is correct way to imports http module?
178. Which of the following is true about Node.JS?
179. Which of the following method resolves an ip address to an array of hostnames?
180. Which function will delete a file?
181. Which of the following methods can be used to read the filenames of a directory?
182. Which of the following methods alone will write a file in Node.js? (check all that apply)
183. What is Callback?
184. REPL stands for :
185. What is the syntax to list all commands in REPL?
186. Which code will return total system memory in bytes? os is included like this: const os = require('os');
187. Which of the following is true about writable stream?
188. What does the following line of code do? var http = require('http');
189. Which method of fs module is used to truncate a file?
190.
How to convert from Buffer instance to string of base64?
191. Which of the following code print the total free memory of operating system?
192.
Select valid stream instances:
193. How can you access the command line arguments passed to your program?
194. Which of the following is the correct way to get a normalized path?
195. What is the output in console of this code? var events = require('events'); var myEventEmitter = new events.EventEmitter(); myEventEmitter.once('a', function () { console.log('a')}); myEventEmitter.on('b', function () { console.log('b')}); myEventEmitter.emit('a'); myEventEmitter.emit('b'); myEventEmitter.emit('a'); myEventEmitter.emit('b');
196. What is the output when the following code is executed? var http = require('http'); var server = http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.end(` Testing Response! ${req.url} ${req.method} `); }); server.listen(3000); console.log('Server listening on port 3000');
197. Which of the following code gets length of a buffer buf?
198. Which of the following code converts a buffer buf to JSON object?
199. What output will this code produce in the console? const EventEmitter = require('events'); const myEmit = new EventEmitter(); myEmit.on('slick', () => {}); myEmit.on('key', () => {}); const symbol = Symbol('init'); myEmit.on(symbol, () => {}); console.log(myEmit.eventNames());
200. Consider the following javascript code. console.log('first'); setTimeout(function() { console.log('second'); }, 0); console.log('third'); What will be the output?
201. Which are the following debug commands to debug node server?
202. For Linux, which of the following environment variables is needed to set for successful NodeJS installation?
203. Which of the following code can make a request to a web server?
204. How to fire event using EventEmitter: var events = new events.EventEmitter();
205. Which of the following is the most popular package manager for Node?
206. The program given in the image should provide the following output:
207. However, lines 11 and 13 contain errors. Which of the following is the correct syntax of line 11 and line 13?
208. Which of the following is a valid JSON object in Node.js?
209. What will be the correct output of the following function? process.nextTick(function(){ console.log('Example')}); console.log('Hello'); console.log('World');
210. Choose True or False: Angular.js uses two-way data-binding for attaining synchronization between the view and the model.
211. In Angular.js, which of the following acts as a link between the view and the model and is passed to the controller?
212. In Node.js, which of the following keywords is used to load a module?
213. Which of the following functions is used to create an HTTPS server? (Consider the two parameters of the function as rq and rs, respectively.)
214. What will be the output of the following code snippet in Node.js? var inherits = require(function Parent(){ this.message ='Example '; } Parent.PrototyPe.exP = function(){ return this.message + 'parent class ' }; function Child(){Parent.call(this); } inherits(Child, Parent); Child.prototype.exp = function () { return Parent.prototype.exp.call(this) + 'child class'; } var chd = new Child(); console.log(chd.exp());
215. Which of the following is not a part of the AAA pattern followed by good tests in chai library?
216. Which of the following testing assertions uses the operator === for testing equality?
217. In Node.js. which of the following modules use(s) the 'require' function? 1) Core module 2) File module 3) External node_modules
218. Which of the following commands is used to get out of an undesirable ellipsis: a situation in which three dots [...] are repeatedly displayed?
219. Which of the following commands in the Node debugger helps user to step out of the current executing function?
220. Which of the following is the correct function of the ng-repeat directive?
221. Which of the following methods is used for setting a signed cookie? Note: Consider the function inside which the method setting is performed as: function (r, s).
222. The following code snippet should provide the output '[125, 450, 80]'. However, line 3 contains an error. What should be the correct syntax of line 3? 1)var m1 =[5.10. 35,125,450. 80. 40]; 2)var _ = require(’underscore'); 3)var output = _(m1. function (vall) 4)[ 5) return val1 >50 6)}): 7)console.log(output);
223. Which of the following code snippets should be added at the top of those files that use the mongodb module?
224. Carefully study the following code snippet and answer the question that follows. var exp = require('express'); var application1 = exp() .use(function (rq, rs){ console.log('Cookie Header:\n', rq.headers['cookie']); rs.cookie('\n name', 'Node.js'); rs.end('Hello Express World'); }).listen(3000); Which of the following code snippets should be added at the top of those files that use the mongodb module?
225. A module 'rimraf' is installed locally in a Node.js project. The following code snippet is supposed to delete a directory named testing2 from the same project however the code contains some errors identify which code lines contain an error. 1.var rim1 = require('rimraf'); 2.rimraf('./Testing2', function(error1)){ 3. if(error1) console.log('This is an error', error1); 4. else console.log('Directory deleted successfully'); 5.}
226. What output will be generated on the execution of the following lines of code? var path = require('path'); console.log(path.join('test1'. 'ltest2'. 'test3'));
227. The following code snippet when executed, should create a web server that serves the web page 'idx.html' from 'testing5' folder. However, the syntax of lines 3 and 4 are not correct. Select the correct replacements of lines 3 and 4 from the given answer options. 1. var exp = require ('express'); 2. var serveStatic = require ('serve-static'); 3. var app = express() 4. .use(serveStatic(dirname /testing5, {'index': ['idx.html']})) 5. .listen(3000);
228. What is the purpose of using URL hashes in Node.js?
229. If you create a collection by using the createCollection method with [safe : true] option, then which of the following types of behaviors will be observed?
230. What will be the output of the following code snippet? var myVar = 'First Value'; if (true) { (function () { var myVar ='Second Value' })(); } console.log(myVar);
231. The HTML code given in the image, when executed, should create a button and hovering over this button should display ‘New Button'. Which of the following code snippets should replace '??' in the given code to obtain the desired result?
232. Study the following code snippet and determine which code line contains an error. 1. var connect =require('connect'), 2. http = require('http'); 3. var app = connect(); 4. http.createServer(http).listen(3000); 5. console.log('port 3000');
233. Which of the following HTTP methods for collection URLs is used to replace the entire collection with a new collection?
234. Carefully study the following code snippet and answer the question that follows: var http = require('http'); var server = http.createServer(function (request1, result1) { console.log('This is request Header'); console.log(request1.headers); result1.write('Working with HTTP'); result1.end(); }).listen(3000); console.log('This is a sample'); When a client request is made, which of the following outputs is obtained on a web browser?
235. What is the default port number on which a node process in debug mode listens for accepting the incoming connections for the purpose of debugging?
236. Which of the given statements is correct about the following program? function mSync (ar1, ar2) { if (ar1){ ar2('Data Cached') } else { setTimeout(function () { ar2('Data Loaded ') }, 2000); } } mSync(true, function (value) { prg1(); }); prg2(); function prg2(){console.log('Good Morning')} function prg1(){console.log('Good Evening')}
237. Which of the following is the correct command for installing the NPM module, underscore?
238. If you generate a private key named 'key.pem', then which of the following commands will be used to generate a corresponding public key?
239. Which of the following are the advantages of node_module? a) It increases reusability. b) It simplifies : ies the long file relative paths. c) It helps in overcoming module incompatibility. d) It is very helpful in changing of URLs without updating the middleware. e) It allows to check the class of a particular object instance.
240. The following function belongs to which of the given http.Server events in Node.js: function (request, socket, head){}
241. Which of the following is the correct command that is used to check the installed version of Node.js on Windows operating system using the C command prompt?
242. Which of the following statements is not correct about Node.js?
243. Which of the following is the correct program code that repeatedly calls a function after every two seconds for continuous eight seconds. and after that clears the interval with the message Which of the following is the correct program code that repeatedly calls a function after every two seconds for continuous eight seconds. and after that clears the interval with the message 'Loop ends' and exits the application?
244. Which of the following is the correct purpose of using the 'exports' keyword in Node.js?
245. What will be the output of the following Node.js program? function first (value1, value2){ console.log('First Process'); setTimeout(value2, 1000, value1); } function second (value1, value2){ console.log('Second Process'); setTimeout( value2, 1000, value1); } function third (value1, value2){ console.log('Third Process'); setTimeout( value2, 1000, value1); } function handleThird(data3){ console.log('Complete:', data3); } function handleSecond(data2) { third(data2, handleThird); } function handleFirst(data1) { third(data1, handleSecond); } first('Process', handleThird);
246. What output will be generated when the following statements are executed in Node.js? var x = H; console.log(x); x.value = 55; console.log(x);
247. Carefully study the given code that is calling the loadJSON method and answer the question that follows. loadJSON('new.json', function (err, data) { if(err)console.log('Error in file reading', err.message); else console.log(data); }); Which of the following is the correct function definition of the loadJSON method such that if a file named 'neW.json' is present in the project, then its data is displayed, otherwise error message (error in file reading) is displayed?
248. What output will be generated on the execution of the following code snippet in Node.js? function Test() {} console.log(Test.prototype.constructor === Test);
249.
Suppose we have the following code in a Node.js file.
var path = require('path');
var completePath ='lexample/test/firsthtml';
Which of the following lines of code should be added to the above code so that the output 'first.html' is displayed?
250. Which of the following is/are true about the http.ServerResponse object in Node.js? 1. It is created by an HTTP server. 2. It is passed as first parameter to the 'request' event. 3. It is a writable stream.
251. What will be the output of the following Node.js code snippet? var EventEmitter = require('events').EventEmitter; Var er = new EVentEmitter(); var handler1 = function () { console.log('Called the handler'); er.removeListener('example', handler1); }; er.on('example', handler1); er.emit('example'); er.emit('example');
252. Choose True or False. In MongoDB, it is possible to insert two values with same_id values into a collection.
253. What will be the output of the following program?var name = 'John';var dob = 15;console.log('%s was born on %d May, 1987', name, dob)
254. Which of the following command line arguments can be used to convert a file named 'base3.js' into an AMD module?
255. State if true or false. In node.js, applications are processed asynchronously on a single thread.
256. Which of the following operators checks whether the given field is an array and contains all the values in the given array of values or not?
257. Which of the following is the purpose of installing the NPM module, optimist?
258. Consider two files: first.js and second.js in a Node.js project. Content of the first.js file is given as: module.exports = function() { console.log('function in file first'); Which of the following lines of code should be written in the second.js file in order to import the function given in the first.js file to the second.js file?
259. Carefully read the following code: 1. var EventEmitter = require('events').EventEmitter; 2. var example = new EventEmitter(); 3. example.on('data', function sample1(){}); 4. example.on('data', function sample2(){}); 5. console.log(???); Which of the given options should replace ??? in line 5 of the above-given code snippet to obtain the following output? [ [Function: sample1], [Function: sample2] ]
260. In Node.js, which of the following functions is used by an Express app to accept the middleware?
261. What will be the output of the following code snippet? var x =[8, 12, 3]; x.push(5); x.unshift(1); console.log(x[0]);
262. In the following program of an asynchronous test, which line of code contains an error? Line 1: exportsaynchabc = function (abc)[ Line 2: setTimeout(function (){ Line 3: abc.equal(false, true); Line 4: abc.done(true. false); Line 5: } 1200); Line 6: };
263. A Node.js project consists of three files: app1.js, app2.js, and app3.js. The code snippets of each of these files are given below. If we execute app2.js, then what output will be obtained? app1.js module.exports = {value1: 'Hello'}app2.jsvar app1 = require('./app1');console.log('Initial value:',app1.value1);app1.value1 = 'World';var app3 = require('./app3');app3.jsvar app3 = require('./app2');console.log('Final value:', app3.value1);
264. In a Node.js application, the 'optimist' module is installed. If the following program is executed in a JavaScript file of this application, then what will be the output?var a1 = require('optimist').argv;delete a1['$0'];console.log(a1);
265. Carefully study the following code snippet and answer the question that follows: new_function (true, function (data){ func1(); }); func2(); function func1(){console.log('Clouds')} function func2(){console.log('Sunshine')} function new_function (ar1, ar2) { if (ar1) { ??? } else { setTimeout(function () { ar2() }, 1000); } } Which of the given code lines should be written in place of '???' in the above program so that the following output is obtained?
266. What will be the output of the following code snippet in Node.js? var x = 2.4; var y = 9; console.log(y/x)
267. The program given in the image should create a web page with a simple label 'Enter name', a text-box and a button. Initially, the text-box should display 'NAME' as its content. The content of the text-box should be cleared each time the button is clicked. However, the program contains some errors. Identify which code lines contain an error.
268. Which of the following classes is/are always used for connecting to a MongoDB server?
269. The following program was designed to create an Express app that displays the output 'Working with Express' on the web browser. But the program contains some errors. Identify which code lines contain an error. 1) var exp1= require('express'); 2) var http: require('http‘); 3) var newapp = exp1() 4) use(function(req. res. next) [ 5) res.end('Working with Express'); 6) i): 7) https.createServer(newapp).listen(3000);
270. A Node.js application consists of an HTML file named ‘idx.html' and a JavaScript file 'ht3.js'. The file ht3.js when executed, should display the content of 'idx.html' file on the web browser. However, the file 'ht3.js' contains some errors. Identify which code lines contain an error. 1. var http = require(‘http'); 2. var fs; 3. function send404(response){ 4. response.writeHead(404. ['Content—Type' :‘text/plain'}); 5. response.write('Error 404: Resource not found'); 6. response.end0: 7. } 8. var server =http.createServer(function(req. res)[ 9. if(req.method = 'GET', req.url =‘/')[ 10. res.writeHead(200, ['content-type' : 'text/html'}); 11. fs.createReadStream('idx.html') 12. ] 13. else[ 14. send404fres); 15. ] 16. ]).listen(3000); 17. console.logf'server running on port 3000');
271. Which of the following is/are not (a) valid state(s) of promise used in Node.js?
272. Which of the following statements are NOT true about promises in Node.js?
273. Which two of the following statements will generate the output 'Hello Node.js'?
274. The given program should generate the following output: The values are: [ [ Value: 15 }, [Value: 8 }]However, the program contains some errors. Identify which code lines contain an error. 1) function addValue(val1. va|2)[ 2) setTimeout(function(){ 3) val2(null. [Value: val1]); 4) ), 500); 5)] 6) function valuesLoaded (loadedVaIues){ 7) console.log(‘The values are:'. loadedVaIues); 8)]< 9) var a = require(Async); 10) a.parallel([function(val) [ 11) addValue(15, val); 12) l. 13) function(val)[ 14) addValue(val, 8); 15)] 16) ],valuesLoaded)
275. Carefully study the following Node.js code snippet and answer the question that follows. 1. var var1 =( 2. xz50. 3. y :'This is a string', 4. z : false 5. ]; 6. varjson_example = stringify.JSON(var1); 7. console.log(json_example); 8. console.log(typeofjson_example ); 9. var json_example1 = JSON.parse(var1); 10. console.log(json_example1); 11. console.log(json_example1.y) Which of the following lines of code contain an error?
276. Carefully study the code snippet given in the image and determine which of the following lines of code contain errors.
277. Which of the following statements is/are correct about working with the MongoDB server and the Mongodb module?
278. The given program should generate the following output:{value1: 2222, value2: [ x: 'hello Worldl', y: 8888 ]]However, the program contains errors. Identify which of the given lines of code contain errors.Program 1. var firstvar =[ 2. value1: 2222, 3. value2: { 4. xz‘hello World!’ 5. y: 8888 6-]; 7. }; 8. console.log(firstvar);
279. When a javaScript function is invoked (called) in Node, where is a new frame placed?
280. Which of the following is a core module in Node?
281. Which of the following Buffer class methods returns an uninitialized buffer?
282. Which of the following modules is NOT a built-in module in Node?
283. Which fs module method can be used to read the content of a file without buffering it in memory?
284. Which of the following DNS module methods uses the underlying OS facilities and does not necessarily perform any network communication?
285. How do you check that a value is a date object in Node?
286. Can you create an https web server with Node.js?
287. What is the Api that is designed to insulate Addons from changes in the underlying JavaScript engine?
288. Which CLI option can you use to debug a node script in Chrome DevTools?
289. How can you count the number of logical CPUs on the machine that is running Node?
290. Which of the following is a method on the console object?
291. Which object is used to manage the cache of required modules?
292. What is the command to silence all process warnings?
293. How can you use the promise API with a callback-based function such as child_process.exec?
294. Which of the following is NOT a Node repl command?
295. Which statement is true when you run the code shown below? require('child_process').fork('script.js');
296. If EventEmitter is in scope, which of the following lines of code will have an event emitter emitting a change event?
297. Which of the following objects is a stream
298. Which module variable holds the resolved absolute path of the current module file?
299. If the child_process module methods are in scope, what is a current way to execute the command ps -ef using a child process?
300. Which console method can be used to print the stack trace to the point of its execution?
301. When you run JavaScript in a Node.js application, which of the following elements in a Node.js stack actually executes that JavaScript?
302. What is the purpose of the path module?
303. How do you make an HTTP server object active and listen to requests on certain ports?
304. How do you start a Node application, if the entry file is indexjs?
305. What is the purpose of the file system (fs) module?
306. What is the Node LTS version?
307. Which of the following is NOT a valid stream in Node?
308. You have a script.js file with the single line of code shown here. What will be the output of executing script.js with the node command? console.log(arguments);
309. Which choice is not a valid method on event emitters?
310. Which special object is an instance of EventEmitter?Which special object is an instance of null?
311. What is the command to get a list of available commands for Node.js?What is the command to get a list of available commands for Node.js?
312. When a request event is received in the HTTP module, what is the type of the first argument passed to that event, usually named req?
313. What are the arguments passed to the module wrapper function?
314. Which library provides Node.js with the event loop?
315. What does the .node file extension represent?
316. What can you export with module.exports?
317. Which core module in Node can you use to take advantage of multicore systems?
318. Which core Node module has wrappers for OpenSSL methods?
319. Which line imports a promise-based version of the readFile method?
320. According to the rules of semantic versioning, what does a release incrementing the third number in an npm version string communicate to users about the release changes?
321. What does REPL stand for?
322. Which file does node-gyp use to read the build configuration of a module?
323. Which core module in Node can you use for testing?
324. Which core module in Node provides an API to register callbacks to track asynchronous resources created inside a Node.js application?
325. Which Node.js module should you use when you need to decode raw data into strings?
326. Which global object acts like a bridge between a Node script and the host operating system?
327. Which statement is true about Node.js and threads?
328. Which statement about event emitters is false?
329. Which core module in Node can you use to compile and run JavaScript code in a sandbox environment?
330. How would you determine the number of cluster instances to start when using the cluster module?
331. You have to read a large text file, replace some words in it, and write it back to a new file. You know that the memory on your target system is limited. What should you do?
332. Which choice is not a Node global object?
333. What is the correct way to pipe a readable stream and a writable stream?
334. How can you convert path segments into a string using the platform-specific separator as a delimiter?
335. What is the purpose of N-API?
336. What is a process object and its role?
337. Is it possible to write tests in Node.js without an external library?
338. Which assert module method is usually used to test the error-first argument in callbacks?
339. Which choice is not a method on the util module?
340. Which choice is not a subclass of the Error class?
341. What is Node built on?
342. How does it affect the performance of a web application when an execution path contains a CPU-heavy operation, such as calculating a long Fibonacci sequence?
343. What is used for parsing and running Javascript in Node.js?
344. What is the importance of having good practices around status code in your response?
345. How can ECMAScript modules be used natively in Node?
346. When exploring the Node documentation's features, what are the stability ratings?
347. Which coice is a core module in Node?