Do you know that? almost 14% freelance on a part-time basis while holding a day job, next

Contact Email: teammmrem@yahoo.com

<< All Upwork (oDesk) and Elance Tests << Elance test answers << IT & Programming category

Test answers for Node.js 2020

(103) Last updated: May 27
Elance • IT & Programming
Questions and answers are regularly updated. Answered and not answered tests questions.

This helps getting job: Hundreds of (cover letter examples , interview questions , profile samples ) • Earn on Upwork (oDesk)
Job assistance: jobs popularityfreelance rates

Popular test answers: HTML, .Net, CSS, English, SEO, Photoshop, iOS, Java, Android, Ruby, Python, JavaScript

See all 6 tests answers updated

Find Upwork (oDesk) and Elance test answers on this website:



Collapse | Expand

103 Answered Test Questions:

1. What program is used to programmtically control the browser?

Answers:

• perl

• javascript

• C#

• vbscript

2. Which of the following is a standard node module, included with the default install?

Answers:

• fs

• csv

• async

• request

3. 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/');

Answers:

• Hello World

• Hello World\n

• Server running at http://localhost:8000/

• undefined

4. A module is an____?

Answers:

• Object

• integer

• an event

• variable

5. How do you call a function attached to an object that will be executed when the object emits an event?

Answers:

• Listener

• Link

• Log

• Buffer

• Process

6. Node.js is stored on your____?

Answers:

• motherboard

• serial bus

• hard drive

• power supply

7. What is node.js based on?

Answers:

• Chrome's JavaScript runtime

• Unix's Websocket layer

• Cocoa's Unix backend

8. What is a Buffer?

Answers:

• Raw memory allocated outside the v8 heap

• Similar to setTimeout in the browser

• A String

9. True or False: node.js can call other command line scripts.

Answers:

• True

• False

10. WebSockets with Socket.io can be used to?

Answers:

• Send messages from the client to the server.

• Send messages from one client to another.

• Send messages from the server to the client.

• All of these.

11. How do you require a module?

Answers:

• var module = require('mymodule')

• #import mymodule

• #include mymodule

• <script src='mymodule' />

12. Which is a comment in node?

Answers:

• >>Comment

• //comment

• Comment

• ?Comment

13. Which of the following can be created and managed using node.js?

Answers:

• Spambots

• Data Compilers

• Webservers

• Chatrooms

• All of these

14. REPL is:

Answers:

• Read-Eval-Print-Loop, a way to interactively run code

• REnder PLaceholders - a templating function

• Replicates an existing Buffer, optionally resetting the size

• A string replacement method

15. To declare a variable use what keyword?

Answers:

• integer

• float

• var

• string

16. The "js" in Node.js stands for?

Answers:

• The creator of the language Jack Snyder

• doesn't stand for anything

• javascript

• Junior Seau

17. NPM is a...

Answers:

• Package manager

• Module

• Web Server

• Sweet Acronym

18. How do you output to console in node.js?

Answers:

• trace or log

• util.log or console.log

• sys.puts or util.puts

19. What function is used to write out application errors/events?

Answers:

• util.log

• process.write

• console.log

• system.inform

20. Which is of the following is a potential advantage of using Node.js?

Answers:

• Node.js is non-blocking and scalable.

• Node.js allows you use the same language on the server and client.

• Node.js is powered by a high-performance V8 engine.

• All of these.

21. In node.js you can write and run code in what language?

Answers:

• Javascript and Java

• Java

• Javascript

• C++

• any language if you have the compiler for those installed on your machine

22. What Javascript Engine does node.js use?

Answers:

• Rhino

• J??gerMonkey

• V8

• SpiderMonkey

• Chakra

23. Use _____ to step through your code.

Answers:

• ruler

• breakpoints

• URL string

• manual

24. If you have a node program called example.js, how would that be excuted?

Answers:

• start example.js

• node example.js

• exec example.js

• launch example.js

25. Why is Node.js important?

Answers:

• Javascript is powerless without the aid of Node.js

• Chrome comes bundled with Node.js and everyong needs Chrome

• Browsers are weak, adding Node.js to your browser beefs it up

• It allows asynchronous processing in the background without interupting the user

26. A popular web application for framework for node?

Answers:

• tab

• maven

• express

• spring

27. In this code:  <code> function myLog(err, data) {   console.log(err, data); }  fs.readFile('/tmp/sample', myLog); </code> The function 'myLog' is used as a(an):

Answers:

• Callback

• Prototype

• Object method

• Filter

28. node.js excels at dealing with:

Answers:

• fibonacci benchmarks

• JRE optimization

• I/O-bound tasks

29. What does Node.js run on?

Answers:

• server

• client

• database

• SAN

30. How does one get access to Node.js?

Answers:

• a part of the browser

• download the install

• a part of the registry

• a part of the OS

31. What is REPL?

Answers:

• Read-Eval-Print-Loop

• Read-Edit-Place-Leverage

• Repeat Languages

32. The Cryptography module requires OpenSSL.

Answers:

• Sometimes

• True

• False

33. How can I call an object function from my module if my module name is "iModule"?

Answers:

• require('iModule').prototype.mObject();

• import('iModule').mObject();

• require('iModule').mObject();

• request('iModule').mObject();

34. Where does Node run on your machine?

Answers:

• in the registry

• in your TIF file

• as an application

• in your browser

35. If you have a problem with your code, where would you look?

Answers:

• app.log

• os.log

• console.log

• system.log

36. What interface is used to access folders on your local drive

Answers:

• file

• drive

• fs

• fso

37. What interface is used to create a server through Node.js

Answers:

• url

• web

• http

• server

38. What is the code to access the DNS module?

Answers:

• require('dns');

• npm_module('dns');

• req('dns');

• request(dns);

39. Which npm command will load all dependencies in the local node_modules folder?

Answers:

• npm load

• npm start

• npm run

• npm install

40. How do you cause a function to be invoked at a specified time later?

Answers:

• process.wait(1000)

• process.wait(fn, 1000)

• process.delay(1000, fn)

• setTimeout(fn, 1000)

• wait(1000)

41. What does the Zlib module provide?

Answers:

• It also offers a set of wrappers for OpenSSL's hash, hmac, cipher, decipher, sign and verify methods.

• Bindings to Gzip/Gunzip, Deflate/Inflate, and DeflateRaw/InflateRaw classes

• Realtime application framework for Node.JS, with HTML5 WebSockets and cross-browser fallbacks support.

• Bindings to application logging classes

42. What does the require call return?

Answers:

• string object

• module.exports object

• none of the above

43. What method is used to parse JSON using NodeJS?

Answers:

• JSON.parse();

• None of the above

• JSON.parseJSON()

• JSON.toJSON()

44. What is node.js?

Answers:

• A program written in C

• Hardware

• An Apache Module

• A program written in Lisp

• jQuery module

45. 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 );

Answers:

• routes.index

• routes.id

• routes.item

• routes.post

46. What do the lines like symbols = symbols || SYMBOLS_DEFAULT; do?

Answers:

• This is a JS idiom for setting default arguments.

• This is a JS idiom for checking that arguments are within a valid range.

• This is a JS idiom for setting symbols to undefined.

• This is a JS idiom for overriding user inputted arguments.

47. Which of these is a built-in module that can be used for unit testing in Node.js?

Answers:

• Test

• Error

• Assert

• Fail

48. How do you start the node.js REPL?

Answers:

• node

• v8

• noderepl

• nodejs

49. To exit out of a function you should use _____?

Answers:

• return;

• exit;

• exit();

• (all of these)

50. True or False: node.js runs in a single thread.

Answers:

• False

• True

51. Which function allows you to chain event listeners?

Answers:

• on()

• connect()

• chain()

• event()

52. The interactive shell is also called_____?

Answers:

• Interface

• HTTPS

• REPL

• SIGINT

53. What syntax is correct for reading environment variable?

Answers:

• process.env.ENV_VARIABLE

• process.ENV_VARIABLE

• node.environment.process['ENV_VARIABLE']

• process.environment.ENV_VARIABLE

54. Timer functions are built into node.js, you do not need to require() this module in order to use them.

Answers:

• true

• false

55. Which of these statements about Express is true?

Answers:

• Express is an MVC framework.

• Express has built-in WebSocket support.

• Express is an NPM module.

• Express comes packaged with Node.js.

56. Which company manages and maintains node.js?

Answers:

• Google

• Notch

• Joyent

• FreeNode

57. 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"

Answers:

• req.query.id

• req.params.id

• req.id

• req.params.post

58. net.Server emits an event every time a ____ connects to the server.

Answers:

• object

• peer

• cat cable

• packet

59. By executing node without any arguments from the command-line:

Answers:

• you will be dropped into the REPL

• you will receive an error message

• node will ask you for arguments

• nothing happens, node needs a file name argument such as "app.js" in order to start

60. Which of these are valid ways to apply middleware in Express?

Answers:

• All of these.

• app.all("*", middleware);

• app.get("/route", middleware, routeHandler );

• app.use( middleware );

61. What built in class is a global type for dealing with binary data directly?

Answers:

• IO

• Process

• Buffer

• Cluster

62. What is typically the first parameter in node.js callback functions?

Answers:

• Error

• Result

• Function

• Status

• Options

63. Node will run until its sure that no further ___ are available.

Answers:

• Utils

• Domains

• Events-handlers

• Processes

64. If an error occures in an Express middleware function, what is the best way to pass the error object to the subsequent handlers?

Answers:

• function( req, res, next){ ... next( err ); }

• function( req, res){ ... res.error( err ); }

• function( req, res ){ ... console.error( err ) }

• function( req, res ){ ... throw err; }

65. The VM module allows one to:

Answers:

• Manage the server's virtual memory

• Run alternative operating systems from within node

• Run Java and .NET bytecode from within node

• Run JavaScript code in a sandbox environment

66. The first argument passed to a Node.js asynchronous callback is always what?

Answers:

• A javascript promise.

• An Error object if an error has occured.

• None of these.

• The result of the function if there is one.

67. In Express, which of these paths would NOT be cosumed by the following route?  "/users/:id/:action?"

Answers:

• "/users/42"

• "/users"

• "/users/test"

• "/users/123/edit"

68. Express middleware is actually handled by what other Node.js module?

Answers:

• Stack

• Request

• Mocha

• Connect

69. Node.js is a truly parallel technology.

Answers:

• False

• True

70. Which of these Express middleware stacks will NOT log favicon requests?

Answers:

• app.use(express.static(__dirname + '/public')); app.use(express.logger()); app.use(express.favicon());

• app.use(express.logger()); app.use(express.static(__dirname + '/public')); app.use(express.favicon());

• app.use(express.favicon()); app.use(express.logger()); app.use(express.static(__dirname + '/public'));

71. In Express, which of these Response methods can NOT automatically end the response?

Answers:

• res.render()

• res.redirect()

• res.type()

• res.send()

72. 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"

Answers:

• req.start

• req.params.start

• req.query.start

• req.prop.start

73. The process object is an instance of what class?

Answers:

• NodeProcesser

• EventProcesser

• NPM

• EventEmitter

74. To create an instance of the HTTP object, which function is used?

Answers:

• order

• require

• suggest

• create

75. True or false? Node.js is multi-core by nature.

Answers:

• Only if compiled properly

• False

• True

76. var http_server = require('http');  how can you create a server?

Answers:

• http.createServer(function(){});

• http.startServer(function(){});

• any of them

• http_server.startServer(function(){});

• http_server.createServer(function(){});

77. The process object is an instance of____?

Answers:

• EventCommand

• EventProcess

• EventHandler

• EventEmitter

78. Node.js clusters are child processes that do NOT share server ports?

Answers:

• false

• true

79. Which of these is definitely true of Node.js?

Answers:

• Node.js is a high-level application framework.

• Node.js can be used to create command line tools.

• Node.js takes full advantage of multithreading.

• Node.js is a very stable platform that is not likely to change in the future.

80. What command is used to end a Node.JS process?

Answers:

• -q

• .exit

• quit

• leave

81. Which of these are required fields in your package.json file?

Answers:

• "name"

• "name", "version", and "description"

• "name", "version", and "dependancies"

• "name" and "version"

82. What is the name of the module system used in node.js?

Answers:

• None - node.js does not use modules

• AMD

• Both - developers choose on a per-module basis

• CommonJS

83. To parse a URL string use____?

Answers:

• urlparse

• querystring

• urlstring

• queryresolve

84. In Node.js, the result of an asynchronous function can be accessed how?

Answers:

• By the value returned by the asynchronous function.

• By the value passed as the second argument of the callback.

• By the value returned by the callback.

• By the value passed as the first argument of the callback.

85. What is NOT a valid method to create a child process instance?

Answers:

• None of these

• spawn()

• fork()

• popen(3)

86. In Express, which of these would NOT expose the variable "title" to the template renderer?

Answers:

• res.locals.title = "My App";

• res.render.title = "My App";

• app.locals({ title: "My App" });

• res.render("template",{ title: "My App" });

87. Which Express middleware must come before express.session() in your stack?

Answers:

• express.sessionParser()

• express.bodyParser()

• express.cookieParser()

• express.static()

88. If an EventEmitter object emits an 'error' event and there is no listener for it, node will:

Answers:

• Print a stack trace and continue running

• Print a stack trace and exit

• Do nothing

• Save a coredump file containing the error data

89. The Javascript used in node.js:

Answers:

• Is on-par with a recent version of WebKit

• Is on-par with a recent version of Chrome

• Is on-par with a recent version of IE

• Is a full ECMAScript 4 implementation

• Is limited to ECMAScript 2 subset

90. The http.ServerResponse is an example of a what?

Answers:

• A callback.

• A pipe.

• A readable Stream.

• A writable Stream.

91. Which of these is NOT a global object?

Answers:

• process

• console

• exports

• Buffer

• Stream

92. Which of the following is not a global object in node.js?

Answers:

• console

• Buffer

• none, node.js doesn't have global objects

• process

• path

93. Which of these is a valid way to output the contents of a file?

Answers:

• fs.readFileSync("file.txt", function(err,data){ console.log(data); });

• console.log( fs.readFileSync("file.txt") );

• console.log( fs.readFile("file.txt") );

94. What is the default memory limit on a node process?

Answers:

• No Limit

• 512mb on 32-bit systems, and 1gb on 64-bit systems.

• 1gb on 32-bit systems, and 2gb on 64-bit systems.

95. 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?

Answers:

• "connect": ">=2.0.0 <2.8.5"

• "connect": "2.x"

• "connect": "1.0.0"

• "connect": ">=2.5"

96. How do you create a new client connection via SSL?

Answers:

• ssl()

• ssl.join()

• ssl.connect()

• tls.connect()

97. 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 )

Answers:

• 3

• 2

• 4

• 1

98. Is it possible to execute node.js system command synchronously?

Answers:

• Yes, with a third party library

• Yes, built in by default.

• No

99. When creating a command line tool with Node.js, which expresion will allow you access the first command line argument?

Answers:

• process.argv[1]

• process.argv[0]

• process.argv[2]

• process.execArgv[0]

100. Which of the following is NOT true about Node 0.6?

Answers:

• Native gzip support

• Integrated master-worker support for load-balancing

• Integrated command-line debugger

• Unix binary distributed

• Windows binary distributed

101. Which of these is not a valid version according to npm semantic versioning?

Answers:

• "1.2.3+build4"

• "1.2.3b"

• "v1.2.3"

• "1.2.3-rc4"

102. Which is a correct way to check the latest released version of the Express module with npm?

Answers:

• npm show version express

• npm express version

• npm view express version

• npm version express

103. A Buffer can be resized.

Answers:

• Sometimes

• True

• False