Quiz
Quiz
js
Week 1
85% marks
Question 1
What is the use of the Underscore Variable in REPL session?
1 point
2.
Question 2
Node.js is a ___________________ language.
1 point
server side
client side
middleware
3.
Question 3
Node.js = ___________________ + ______________________.
1 point
JavaScript Library
4.
Question 4
The v8 engine works inside the _____________ of the browser.
1 point
Network API
Core OS
DOM context
File system
5.
Question 5
All APIs of Node.js libraries are _______________.
1 point
synchronous
blocking
unblocking
asynchronous
6.
Question 6
___________ is the package manager for Node.
1 point
npn
mpm
npm
7.
Question 7
_________________ is a Node.js component.
1 point
DOM
Node CLI
package-lock.json
Question 8
Asynchronous Jobs run on ___________ threads.
1 point
worker
executable
daemon
Multiple
9.
Question 9
Node.js is not suited for _________________ since it is single threaded.
1 point
IO intensive operations
10.
Question 10
Variables are _____________ for storing data.
1 point
containers
compilers
integrators
Controllers
11.
Question 11
The const declaration creates a ____________ reference to a value.
1 point
read-write
read-only
write-only
12.
Question 12
What is the output of the code snippet given below? console.log(age)
var age = 30
console.log(age)
1 point
undefined
30
error in code
13.
Question 13
The process object is a __________ object.
1 point
global
local
hoisted
14.
Question 14
Command line arguments can be accessed through the ________________ functionality.
1 point
process
process.arg
process.argc
process.argv
15.
Question 15
The "function" and " var" are known as ________.
1 point
keywords
datatypes
declaration keywords
prototypes
16.
Question 16
In the following syntax of the switch statement, the Expression is compared with the labels using
which of the following operators? switch(expression) { statements }
1 point
"==="
"=="
"="
equals
17.
Question 17
What is the output of the code snippet given below? var count =0; while (count ```<10) {
console.log(count); count++; }
1 point
Infinite loop
Prints undefined
18.
Question 18
What is the output of the code snippet given below? var stringValue = "40"; var intValue = 50;
console.log( stringValue + intValue);
1 point
90
40
error
4050
19.
Question 19
What is the output of the code snippet given below? var x = 0 while (x != 0) { if(x == 1) continue;
else x++; }
console.log(x)
1 point
infinite loop
20.
Question 20
What is the output of the code snippet given below? var a=0; var b =0; while (a ```<3) { a++; b +=
a; console.log(b); }
1 point
1,1,1
1,3,6
1,3,7
1,3,5
Week 2
95% Marks
1.
Question 1
A function with no return value is called__________function.
1 point
Procedure
Method
Static function
Dynamic function
2.
Question 2
What will be the output of a return statement if it does not have an associated expression?
1 point
It is manditory
Not necessary
Function
Object
25 169
36 169
undefined 72
undefined 169
7.
36
square (6)
144
ab is not defined
ab is not a function
x is not defined
9.
Question 9
Whatwill be the output of function if printed? var make Noise = function () { console.log (" Pling !")
; }; make Noise();
1 point
Pling !
inside
Error at line 1
inside function 12 12
inside function x 12
1024
100
20
Predict the output of the following program: var carMakes = ; console.log('Old array : '
+carMakes.join()); carMakes.sort(); carMakes.reverse(); console.log('Array in reverse order: '
+carMakes.join());
1 point
true false
false true
true true
false false
18.
Question 18
Which of the following statements defines the pop() method?
1 point
Reverses
Returns [1,2,3]
Returns [4,5]
Returns [1,2,3,4]
Returns [1,2,3,4,5]
21.
Question 21
Predict the final output of the following program: var a = ; a.unshift(1); a.unshift(22); a.shift();
a.unshift(3, ); a.shift(); a.shift(); a.shift();
1 point
[4,5]
[3,4,5]
Execption is thrown
22.
Question 22
What is the use of array map() function?
1 point
Passes each element of the array and returns the necessary mapped elements.
Passes each element of the array on which it is invoked to the function you specify, and
returns an array containing the values returned by that function.
Week 3
95% Marks
1.
Question 1
Which of the following statements is true for package.json?
1 point
os module
net module
fs module
path module
3.
Question 3
Which of the following commands will show all the locally installed modules?
1 point
npm ls -g
node ls -g
npm ls
node ls
4.
os module
path module
fs module
HTTP module
5.
Question 5
Which of the following options is an incorrect expression to expose a function in Node.js
1 point
1 point
You can have multiple methods and variables exported from a module.
Once you have exported a method, it must refer to valid JavaScript expression.
If you don't export any thing from the module, it will not be usable by other part of your
code/project.
EventEmitter
Events
NodeEvent
Node.exe
module.exports
REPL
11.
Question 11
Single or multiple files organized in JavaScript having simple or complex functionality that can be
reused throughout Node.js application are called _________.
1 point
Function
Package
Module
Library
12.
Question 12
Which of the following statements is true for CommonJS modules?
1 point
CommonJS modules are loaded synchronously and processed in the order the JavaScript
runtime finds them.
The CommonJS module specification is the standard used in NodeJS for working with modules.
os.platform()'
os.cpus()'
os.hostname()
os.getHostname()'
15.
Question 15
How will you import any module in Node.js?
1 point
http
fs
stream
Lodash
17.
Question 17
Lodash module is used for ________.
1 point
Lodash contains tools to simplify programming with strings, numbers, arrays, functions
and objects.
18.
Question 18
Which of the following statements is true for Path Module?
1 point
The goal of node_modules file is to keep track of the exact version of every package that is
installed and also the location from where they are installed.
This acts as a cache for the external modules that the project
depends upon. When npm install is done, the packages get downloaded from
the npm registry and are copied into the node_modules folder and Node.js looks for them
when you import them.
It's the package.json file that enables npm to start the project, run scripts, install dependencies,
and publish to the npm registry.
20.
Question 20
Which of the following statements is true for url module?
1 point
Week 4
90% Marks
1.
Question 1
Each function of a JavaScript program will be pushed onto the _______________ in the order of calling.
1 point
call stack
heap memory
task queue
event loop
2.
Question 2
JavaScript is _______________ by default.
1 point
asynchronous
synchronous
non-blocking
function
error
variable
argument
variable
function
Event Loop
Event Queue
Thread Pool
7.
Question 7
The Event Loop processes _______________ requests.
1 point
Blocking
Promise
Callback
Non-blocking
8.
Question 8
Each _________ of the event loop maintains a separate callback queue.
1 point
step
phase
loop
setTimeout()
setImmediate()
process.nextTick()
10.
Question 10
The _____________ queue is for resolving promises.
1 point
process.nextTick()
poll
microtasks
timer callback
11.
Question 11
Each time the event loop takes a full trip completing all the phases, it is called a __________.
1 point
nextTick
tick.
phase
poll
12.
Question 12
A Promise is said to be in pending state when ______________.
1 point
reslove
onRejected
onFulfilled
reject
14.
Question 14
What will be the output of the following code snippet ?
setTimeout(() => {
resolve([6,7,8])
reject('error in code')
}, 2000);
})
add.then((result)=>{
console.log("Success ! "+result)
}).catch((error)=>{
console.log(error)
})
1 point
Success ! 6,7,8
error in code
15.
Question 15
What will be the output of the following code snippet ?
startTime = ()=> {
let h = today.getHours();
let m = today.getMinutes();
let s = today.getSeconds();
m = checkTime(m);
s = checkTime(s);
setTimeout(startTime, 1000);
return i;
StartTime()
1 point
Infinite loop
value
function
callback
promise
17.
Question 17
______________________ helps you define a list of promises, and execute something when they are all
resolved.
1 point
Promise.any()
Promise.race()
Promise.all()
Promise.new()
18.
Question 18
What is the output of the below code ?
setTimeout(() => {
console.log('after ')
}, 0)
before, after
after,before
before
after
19.
Question 19
await
async functions
callback functions
functions
20.
Question 20
Debugging __________________ is hard because the debugger will not step over asynchronous code.
1 point
await
async functions
callback functions
promises
Week 5
95% Marks
1.
Question 1
Which of the following statements is true for EventEmitter.emit property?
1 point
2.
Question 2
Which of the following statements is false about Streams?
1 point
fs.stat(path, callback)
fs.watchFile(path, callback)
4.
Question 4
Which of the following methods of fs module is used to read a directory?
1 point
fs.readDirectory(path , callback)
fs.read(path , callback)
fs.readdir(path, callback)
NodeJS implements File I/O using simple wrappers around standard POSIX function.
All the File I/O operations( read , write, append) are asynchronous by default
6.
Question 6
Which of the following statements is true for EventEmitter.on property?
1 point
fs.close(fd, callback)
fs.closeFile(fd, callback)
fs.closePath(fd, callback)
fs.closefile(fd, callback)
8.
Question 8
Which of the following events is not supported by Readable Streams in NodeJS?
1 point
Event data
Event end
Event cork
9.
Question 9
Which of the following is a benefit of using Stream processing?
1 point
emitter.observe
emitter.once
emitter.emit
emitter.on
11.
Question 11
Which of the following Classes is used to implement NodeJS Streams?
1 point
Memory Buffers
Event Loop
Promises
EventEmitters
12.
Readable Stream
Writable Stream
Transform Stream
The Buffer object is a global object in NodeJS, and it is not necessary to import it
using the require keyword.
To use the Buffer object we need to import the global Buffer Object by writing require('Buffer')
14.
Question 14
Which of the following scenarios is possible using Streams?
1 point
Event data
Event `drain
Event pipe
Event unpipe
16.
Question 16
Which of the following classes is used to create custom event in NodeJS?
1 point
Event
EventEmitter
Buffer
fs.appendFile()
fs.writeFile()
require('fs')
require('http')
require('stream')
require('events')
20.
Question 20
Which of the folloiwng methods can be used to read a file asynchronously?
1 point
fs.read( filename )
Week 6
100% Marks
1.
Question 1
What are the types of errors that can occur in a Node.js application?
1 point
Logical
Operational
Syntax
Runtime
3.
Question 3
Semantic
Operational
Logical
Assertion error
User-defined error
System error
objects
Error classes
Exceptions
JS libraries
6.
Question 6
throws
throw
try …. Catch
finally
7.
Question 7
The try block contains the ___________ code that can throw an error
1 point
critical
normal
control flow
new Error()
new Error(message)
new Error(filename)
throw
throws
new
try..catch
10.
Question 10
throws
try..catch
finally
function
11.
Question 11
The _____________ statement is attached in the program to invoke the inbuilt debugger through
running the inspect command.
1 point
debug
debugger
start debugger
begin debug
13.
Question 13
________________ is a place in the program where the execution is stopped by the debugger
1 point
Step over
Step into
Breakpoint
Watch
Call stack
debugger
explorer
15.
Question 15
Software Debugging
Software Diagnosis
Software Testing
Diagnosis Monitor
Report
Diagnostic Report
.csv
.txt
.js
process
prototype
local
reportOnSignal
reportOnFatalError
reportOnUncaughtException
reportOnException
20.
Question 20
The ____________ terminal is used to execute code in the debug mode in Node.js
1 point
JavaScript Debug
powershell
command prompt
debugger
Week 7
86% Marks
1.
Question 1
Predict the output of the following code snippet:
function makeAdder(a) {
return function(b) {
return a + b;
};
add5(6);
1 point
11
error
2.
Question 2
Predict the output of the following code snippet:
console.log(str.includes('Web', 10));
1 point
1
3.
Question 3
function subtract( x = y, y = 1 ) {
return x - y;
subtract(10);
1 point
10
error
4.
Question 4
Predict the output of the following code snippet:
1 point
protractor,watir,selenium,cucumber
protractor,watir,uft,selenium,cucumber
watir,uft,cypress,selenium,cucumber
watir,cypress,selenium,cucumber
5.
Question 5
Predict the output of the following code snippet: var iyal = ; iyal = 'puram'; console.log ( iyal.length)
1 point
100
101
7.
Question 7
Which of the following is the correct method for getting the elements using their class name?
1 point
document.getElementsByClassName()
document.getElementByClass()
document.getElementByClassName()
document.getElementsByClass()
8.
Question 8
Which of the following options is true about JavaScript?
1 point
It is an Interpreted Language
Option 1 and 2
9.
Question 9
Functions that take other functions as arguments are known as ___________.
1 point
Callback Functions
Asynchronous Functions
Anonymous functions
HigherOrder Functions
10.
Question 10
Which function of an Array object calls a function for each element in the array?
1 point
push()
forEach()
forEvery()
each()
11.
Question 11
Predict the output of the following code snippet:
console.log('3' + 4 + 5);
1 point
345
12
75
javascript
java
hi,welcome to java
hi,welcome to javascript
13.
Question 13
Predict the output of the following code snippet:
1
14.
Question 14
Predict the output of the following code snippet:
1
15.
Question 15
Predict the output of the following code snippet:
0
16.
Question 16
Predict the output of the following code snippet:
0
17.
Question 17
Predict the output of the following code snippet:
0
18.
Question 18
Identify the syntax for excluding a specific testcase.
1 point
19.
Question 19
Identify the syntax for excluding a specified testsuite.
1 point
20.
Question 20
Identify the syntax for running only an individual testcase.
1 point
21.
Question 21
Identify the syntax for running only a specified testsuite.
1 point
22.
Question 22
Identify the Hooks provided by Mocha.
1 point
before,after
before,after,beforeeach,aftereach
beforeeach,aftereach