UpWork (oDesk) & Elance Node.js Test Question & Answers
UpWork (oDesk) & Elance Node.js Test Question & Answers are really very important to pass UpWork & Elance test. You will get top score at this skill test exam. If you found any problem or wrong answer please inform me via contact or comments. We will try to solve it in short. This test is extremely valuable to acquire knowledge of this skill. Lets Start test.
Ques : What do the lines like symbols = symbols || SYMBOLS_DEFAULT; do?
Ans : This is a JS idiom for setting default arguments.Ques : What do the lines like symbols = symbols || SYMBOLS_DEFAULT; do?
Ques : True or False: node.js can call other command line scripts.
Ans : True
Ques : The "js" in Node.js stands for?
Ans : javascript
Ques : Why is Node.js important?
Ans : It allows asynchronous processing in the background without interupting the user
Ques : Why is Node.js important?
Ans : It allows asynchronous processing in the background without interupting the user
Ques : To exit out of a function you should use _____?
Ans : return;
Ques : The process object is an instance of what class?
Ans : EventEmitter
Ques : To create an instance of the HTTP object, which function is used?
Ans : require
Ques :True or false? Node.js is multi-core by nature.
Ans : False
Ques : The process object is an instance of____?
Ans : EventEmitter
Ques : To parse a URL string use____?
Ans : querystring
Ques : The Javascript used in node.js:
Ans : Is on-par with a recent version of Chrome
Ques : What program is used to programmtically control the browser?
Ans : javascript
Ques : Which of the following is a standard node module, included with the default install?
Ans : fs
Ques : 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/');
Ans : Server running at http://localhost:8000/
Ques : A module is an____?
Ans : Object
Ques : How do you call a function attached to an object that will be executed when the object emits an event?
Ans : Listener
Ques : Node.js is stored on your____?
Ans : hard drive
Ques : What is node.js based on?
Ans : Chrome's JavaScript runtime
Ques : What is a Buffer?
Ans : Raw memory allocated outside the v8 heap
Ques : WebSockets with Socket.io can be used to?
Ans : All of these.
Ques : How do you require a module?
Ans : var module = require('mymodule')
Ques : Which is a comment in node?
Ans : //comment
Ques : Which of the following can be created and managed using node.js?
Ans : All of these
Ques : REPL is:
Ans : Read-Eval-Print-Loop, a way to interactively run code
Ques : To declare a variable use what keyword?
Ans : var
Ques : NPM is a...
Ans : Package manager
Ques : How do you output to console in node.js?
Ans : util.log or console.log
Ques : What function is used to write out application errors/events?
Ans : console.log
Ques : Which is of the following is a potential advantage of using Node.js?
Ans : All of these.
Ques : In node.js you can write and run code in what language?
Ans : Javascript
Ques : What Javascript Engine does node.js use?
Ans : V8
Ques : Use _____ to step through your code.
Ans : breakpoints
Ques : If you have a node program called example.js, how would that be excuted?
Ans : node example.js
Ques : A popular web application for framework for node?
Ans : express
Ques :In this code: function myLog(err, data) { console.log(err, data); } fs.readFile('/tmp/sample', myLog); The function 'myLog' is used as a(an):
Ans : Callback
Ques : node.js excels at dealing with:
Ans : I/O-bound tasks
Ques : What does Node.js run on?
Ans : server
Ques : How does one get access to Node.js?
Ans : download the install
Ques : What is REPL?
Ans : Read-Eval-Print-Loop
Ques : The Cryptography module requires OpenSSL.
Ans : True
Ques : How can I call an object function from my module if my module name is "iModule"?
Ans : require('iModule').mObject();
Ques : Where does Node run on your machine?
Ans : as an application
Ques : If you have a problem with your code, where would you look?
Ans : console.log
Ques : What interface is used to access folders on your local drive
Ans : fs
Ques : What interface is used to create a server through Node.js
Ans : http
Ques : What is the code to access the DNS module?
Ans : require('dns');
Ques : Which npm command will load all dependencies in the local node_modules folder?
Ans : npm install
Ques : How do you cause a function to be invoked at a specified time later?
Ans : setTimeout(fn, 1000)
Ques : What does the Zlib module provide?
Ans : setTimeout(fn, 1000)
Ques : What does the Zlib module provide?
Ans : Bindings to Gzip/Gunzip, Deflate/Inflate, and DeflateRaw/InflateRaw classes
Ques : What does the require call return?
Ans : module.exports object
Ques : What method is used to parse JSON using NodeJS?
Ans : JSON.parse();
Ques : What is node.js?
Ans : A program written in C
Ques : 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 );
Ans : routes.id
Ques : Which of these is a built-in module that can be used for unit testing in Node.js?
Ans : Assert
Ques : How do you start the node.js REPL?
Ans : node
Ques : True or False: node.js runs in a single thread.
Ans : True
Ques : Which function allows you to chain event listeners?
Ans : on()
Ques : The interactive shell is also called_____?
Ans : REPL
Ques : What syntax is correct for reading environment variable?
Ans : process.env.ENV_VARIABLE
Ques : Timer functions are built into node.js, you do not need to require() this module in order to use them.
Ans : true
Ques : Which of these statements about Express is true?
Ans : Express is an NPM module.
Ques : Which company manages and maintains node.js?
Ans : Joyent
Ques : 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"
Ans : req.params.id
Ques : net.Server emits an event every time a ____ connects to the server.
Ans : peer
Ques : By executing node without any arguments from the command-line:
Ans : you will be dropped into the REPL
Ques : Which of these are valid ways to apply middleware in Express?
Ans : All of these.
Ques : What built in class is a global type for dealing with binary data directly?
Ans : Buffer
Ques : What is typically the first parameter in node.js callback functions?
Ans : Error
Ques : Node will run until its sure that no further ___ are available.
Ans : Events-handlers
Ques : If an error occures in an Express middleware function, what is the best way to pass the error object to the subsequent handlers?
Ans : function( req, res, next){ ... next( err ); }
Ques : The VM module allows one to:
Ans : Run JavaScript code in a sandbox environment
Ques : The first argument passed to a Node.js asynchronous callback is always what?
Ans : An Error object if an error has occured.
Ques : In Express, which of these paths would NOT be cosumed by the following route? "/users/:id/:action?"
Ans : "/users"
Ques : Express middleware is actually handled by what other Node.js module?
Ans : Connect
Ques : Node.js is a truly parallel technology.
Ans : False
Ques : Which of these Express middleware stacks will NOT log favicon requests?
Ans : app.use(express.favicon()); app.use(express.logger()); app.use(express.static(__dirname + '/public'));
Ques : In Express, which of these Response methods can NOT automatically end the response?
Ans : res.type()
Ques : 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"
Ans : req.query.start
Ques : var http_server = require('http'); how can you create a server?
Ans : http_server.createServer(function(){});
Ques : Node.js clusters are child processes that do NOT share server ports?
Ans : false
Ques : Which of these is definitely true of Node.js?
Ans : Node.js can be used to create command line tools.
Ques : What command is used to end a Node.JS process?
Ans : .exit
Ques : Which of these are required fields in your package.json file?
Ans : "name" and "version"
Ques : What is the name of the module system used in node.js?
Ans : CommonJS
Ques : In Node.js, the result of an asynchronous function can be accessed how?
Ans : By the value passed as the second argument of the callback.
Ques : What is NOT a valid method to create a child process instance?
Ans : popen(3)
Ques : In Express, which of these would NOT expose the variable "title" to the template renderer?
Ans : res.render.title = "My App";
Ques : Which Express middleware must come before express.session() in your stack?
Ans : express.cookieParser()
Ques : If an EventEmitter object emits an 'error' event and there is no listener for it, node will:
Ans : Print a stack trace and exit
Ques : The http.ServerResponse is an example of a what?
Ans : A writable Stream.
Ques : Which of these is NOT a global object?
Ans : Stream
Ques : Which of the following is not a global object in node.js?
Ans : path
Ques : Which of these is a valid way to output the contents of a file?
Ans : console.log( fs.readFileSync("file.txt") );
Ques : What is the default memory limit on a node process?
Ans : 512mb on 32-bit systems, and 1gb on 64-bit systems.
Ques : 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?
Ans : "connect": ">=2.5"
Ques : How do you create a new client connection via SSL?
Ans : tls.connect()
Ques : 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 )
Ans : 4
Ques : Is it possible to execute node.js system command synchronously?
Ans : Yes, with a third party library
Ques : When creating a command line tool with Node.js, which expresion will allow you access the first command line argument?
Ans : process.argv[2]
Ques : Which of the following is NOT true about Node 0.6?
Ans : Unix binary distributed
Ques : Which of these is not a valid version according to npm semantic versioning?
Ans : "1.2.3b"
Ques : Which is a correct way to check the latest released version of the Express module with npm?
Ans : npm view express version
Ques : A Buffer can be resized
Ans : False
Thanks for watching this test Question & Answers. Please don't forget to leave a comment about this post. You can also find some more effective test question & answers, information, techniques, technology news, tutorials, online earning information, recent news, results, job news, job exam results, admission details & another related services on the following sites below. Happy Working!
News For Todays UpWork Elance Tests oEtab ARSBD-JOBS DesignerTab
UpWork (oDesk) & Elance Node.js Test Question & Answers
Reviewed by ARSBD
on
June 30, 2015
Rating: