UNPKG

node-quizzer

Version:

A module for generating and evaluating random quizzes

721 lines 21.7 kB
{ "email": "", "quizzes": { "nodejs": [ { "qid": 0, "graded": true, "type": 1, "title": "In which of the following areas, Node.js is not advised to be used?", "desc": null, "code": null, "lang": null, "opts": [ "Single Page Applications", "JSON APIs based Applications", "CPU intensive applications", "Data Intensive Realtime Applications (DIRT)" ], "correct": [2] }, { "qid": 1, "graded": true, "type": 1, "title": "Which of the following command will show version of npm?", "desc": null, "code": null, "lang": null, "opts": [ "$ npm --version", "$ node --version", "$ npm getVersion", "$ node getVersion" ], "correct": [0] }, { "qid": 2, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following is true about Node.JS?", "opts": [ "Node.js is a JavaScript based framework/platform built on Google Chrome's JavaScript V8 Engine.", "Node.JS is used to delevop I/O intensive web applications like video streaming sites, single page applications and other web application.", "Node.js is open source and is completely free to use.", "All of the above." ], "correct": [3] }, { "qid": 3, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "What npm stands for?", "opts": [ "Node Package Manager", "Node Project Manager", "New Project Manager", "New Package Manager" ], "correct": [0] }, { "qid": 4, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following is true with respect to Node.", "opts": [ "Every API of Node js are asynchronous.", "Node being a single thread, and uses async function calls to maintain the concurrency.", "Node thread keeps an event loop and whenever any task get completed, it fires the corresponding event which signals the event listener function to get executed.", "All of the above." ], "correct": [1] }, { "qid": 5, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which method of fs module is used to read a file?", "opts": [ "fs.open(path, flags[, mode], callback)", "fs.openFile(path, flags[, mode], callback)", "fs.openPath(path, flags[, mode], callback)", "fs.read(fd, buffer, offset, length, position, callback)" ], "correct": [3] }, { "qid": 6, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which method of fs module is used to truncate a file?", "opts": [ "fs.delete(fd, len, callback)", "fs.remove(fd, len, callback)", "fs.ftruncate(fd, len, callback)", "None of the above." ], "correct": [2] }, { "qid": 7, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following is true about console global object?", "opts": [ "There are built-in methods to be used for printing informational, warning and error messages in console.", "console is used in synchronous way when destination is file or a terminal.", "console is used in asynchronous way when destination is a pipe.", "All of the above." ], "correct": [3] }, { "qid": 8, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following is the correct way to get a joint path?", "opts": [ "path.join('/test', 'test1', '2slashes/1slash', 'tab', '..')", "path.combine('/test', 'test1', '2slashes/1slash', 'tab', '..')", "buffer.join('/test', 'test1', '2slashes/1slash', 'tab', '..')", "None of the above." ], "correct": [0] }, { "qid": 9, "graded": true, "type": 0, "desc": null, "code": null, "lang": null, "title": "net.isIP(input) tests if input is an IP address or not.", "opts": [ "true", "false" ], "correct": [0] }, { "qid": 10, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following is true about external binding with respect to domain module?", "opts": [ "Error emmitter is executing its code within run method of a domain.", "Error emmitter is added explicitly to a domain using its add method.", "Both of the above.", "None of the above." ], "correct": [1] }, { "qid": 11, "graded": true, "type": 0, "desc": null, "code": null, "lang": null, "title": "Duplex stream can be used for both read and write operation.", "opts": [ "true", "false" ], "correct": [0] }, { "qid": 12, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "All APIs of Node.JS are.", "opts": [ "Asynchronous", "Synchronous", "Both of the above.", "None of the above." ], "correct": [0] }, { "qid": 13, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following command will show version of Node?", "opts": [ "$ npm --version", "$ node --version", "$ npm getVersion", "$ node getVersion" ], "correct": [1] }, { "qid": 14, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following code converts a buffer buf to JSON object?", "opts": [ "buf.toJSON()", "buf.json()", "buf.covertToJson()", "buf.jsonify()" ], "correct": [0] }, { "qid": 15, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following is true about File I/O in Node applications?", "opts": [ "Node implements File I/O using simple wrappers around standard POSIX functions.", "Node File System (fs) module should be imported for File I/O opearations.", "Both of the above.", "None of the above." ], "correct": [2] }, { "qid": 16, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following is true about setInterval(cb, ms) global function?", "opts": [ "The setInterval(cb, ms) global function is used to run callback cb repeatedly after at least ms milliseconds.", "The setInterval(cb, ms) method returns an opaque value that represents the timer which can be used to clear the timer using the function clearInterval(t).", "Both of the above.", "None of the above." ], "correct": [2] }, { "qid": 17, "graded": true, "type": 0, "desc": null, "code": null, "lang": null, "title": "Is process a global object?", "opts": [ "true", "false" ], "correct": [0] }, { "qid": 18, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following API creates a server?", "opts": [ "net.createServer([options][, connectionListener])", "net.connect(options[, connectionListener])", "net.createConnection(port[, host][, connectListener])", "None of the above." ], "correct": [0] }, { "qid": 19, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following stands true for dns.lookup(hostname[, options], callback) method?", "opts": [ "Resolves a hostname (e.g. 'google.com') into the first found A (IPv4) or AAAA (IPv6) record.", "If options is not provided, then IP v4 and v6 addresses are both valid. If options is an integer, then it must be 4 or 6.", "Both of the above.", "None of the above." ], "correct": [2] }, { "qid": 20, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "What REST stands for?", "opts": [ "REpresentational State Transfer", "Resource Efficient State Transfer", "Real Elegant State Transfer", "Resource Elegant State Transfer" ], "correct": [1] }, { "qid": 21, "graded": true, "type": 0, "desc": null, "code": null, "lang": null, "title": "A stream fires data event when there is data available to read.", "opts": [ "false", "true" ], "correct": [1] }, { "qid": 22, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "How Node based web servers are different from traditional web servers?", "opts": [ "Node based server process request much faster than traditional server.", "Node based server uses a single threaded model and can services much larger number of requests than traditional server like Apache HTTP Server.", "There is no much difference between the two.", "None of the above." ], "correct": [1] }, { "qid": 23, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "What is use of Underscore Variable in REPL session?", "opts": [ "to get the last command used.", "to get the last result.", "to store the result.", "None of the above." ], "correct": [1] }, { "qid": 24, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following code converts a buffer buf to JSON object?", "opts": [ "buf.toJSON()", "buf.json()", "buf.covertToJson()", "buf.jsonify()" ], "correct": [0] }, { "qid": 25, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which method of fs module is used to close a file?", "opts": [ "fs.close(fd, callback)", "fs.closeFile(fd, callback)", "fs.closePath(fd, callback)", "None of the above." ], "correct": [0] }, { "qid": 26, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following is true about __filename global object?", "opts": [ "The __filename represents the filename of the code being executed.", "The __filename represents the resolved absolute path of code file.", "Both of the above.", "None of the above." ], "correct": [2] }, { "qid": 27, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following is true about console global object?", "opts": [ "There are built-in methods to be used for printing informational, warning and error messages in console.", "console is used in synchronous way when destination is file or a terminal.", "console is used in asynchronous way when destination is a pipe.", "All of the above." ], "correct": [3] }, { "qid": 28, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following code print the platform of operating system?", "opts": [ "console.log('platform : ' + os.platform);", "console.log('platform : ' + os.platform());", "console.log('platform : ' + os.getPlatform());", "None of the above." ], "correct": [1] }, { "qid": 29, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following stands true for dns.lookup(hostname[, options], callback) method?", "opts": [ "Resolves a hostname (e.g. 'google.com') into the first found A (IPv4) or AAAA (IPv6) record.", "If options is not provided, then IP v4 and v6 addresses are both valid. If options is an integer, then it must be 4 or 6.", "Both of the above.", "None of the above." ], "correct": [2] }, { "qid": 30, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "What REST stands for?", "opts": [ "REpresentational State Transfer", "Resource Efficient State Transfer", "Real Elegant State Transfer", "Resource Elegant State Transfer" ], "correct": [0] }, { "qid": 31, "graded": true, "type": 0, "desc": null, "code": null, "lang": null, "title": "Each type of Stream is an EventEmitter.", "opts": [ "true", "false" ], "correct": [0] }, { "qid": 32, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Why code written in Node.JS is pretty fast although being written in JavaScript?", "opts": [ "Node.JS internally converts JavaScript code to Java based code and then execute the same.", "Node.JS internally converts JavaScript code to C based code and then execute the same.", "Being built on Google Chrome's V8 JavaScript Engine.", "None of the above." ], "correct": [2] }, { "qid": 33, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following command will show version of Node?", "opts": [ "$ npm --version", "$ node --version", "$ npm getVersion", "$ node getVersion" ], "correct": [1] }, { "qid": 34, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following provides in-built events.", "opts": [ "events", "callback", "throw", "handler" ], "correct": [0] }, { "qid": 35, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which method of fs module is used to get information about file?", "opts": [ "fs.open(path, flags[, mode], callback)", "fs.stat(path, callback)", "fs.readFile(path, flags[, mode], callback)", "None of the above." ], "correct": [1] }, { "qid": 36, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following is true about setTimeout(cb, ms) global function?", "opts": [ "The setTimeout(cb, ms) global function is used to run callback cb after at least ms milliseconds.", "The setTimeout(cb, ms) function returns an opaque value that represents the timer which can be used to clear the timer.", "Both of the above.", "None of the above." ], "correct": [2] }, { "qid": 37, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following code prints current directory?", "opts": [ "console.log('Current directory: ' + process.cwd());", "console.log('Current directory: ' + console.cwd());", "console.log('Current directory: ' + process.currenWorkingDirectory());", "None of the above." ], "correct": [0] }, { "qid": 38, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following module is required for network specific operations?", "opts": [ "os module", "fs module", "net module", "None of the above." ], "correct": [2] }, { "qid": 39, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following method resolves an ip address to an array of hostnames?", "opts": [ "dns.reverse(ip, callback)", "dns.resolve(hostname[, rrtype], callback)", "dns.resolve4(hostname, callback)", "None of the above." ], "correct": [0] }, { "qid": 40, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following is true about exec methd of child_process module.", "opts": [ "The exec() method runs a command in a shell and buffers the output. ", "The exec() method returns a buffer with a max size.", "The exec() method waits for the process to end and tries to return all the buffered data at once.", "All of the above." ], "correct": [3] }, { "qid": 41, "graded": true, "type": 1, "desc": null, "code": null, "lang": null, "title": "Which of the following is not a valid HTTP method?", "opts": [ "get", "put", "post", "header" ], "correct": [3] } ], "javascript": [ { "qid": 1, "graded": true, "type": 2, "desc": "Review the following code:", "code": "function test() {\r\n console.log('hello');\r\n}", "lang": "js", "title": "Will the console.log be displayed?", "rule": "no|it won't|doesn't", "ruleOpts": "gi" }, { "qid": 2, "graded": true, "type": 3, "desc": "Review the following code:", "code": "function anotherTest() {\r\n console.log('hello');\r\n}\r\nanotherTest();", "lang": "js", "title": "Will the console.log be displayed?" }, { "qid": 3, "graded": true, "type": 0, "desc": "Review the following code:", "code": "function ping() {\r\n return 10;\r\n}\r\nping();", "lang": "js", "title": "Will the method return 10?", "opts": [ "true", "false" ], "correct": [0] }, { "qid": 4, "graded": false, "type": 1, "desc": "Review the following code:", "code": ".test {\r\n background:#f00;\r\n}", "lang": "css", "title": "What type of code is this?", "opts": [ "js", "css", "perl", "none of the above" ], "correct": [1] } ] } }