Font size
WorksheetsSec-E Quiz-19-4-23
Total questions: 120
Worksheet time: 3600secs
Which programming language is the Google V8 Engine designed for?
Java
JavaScript
Python
R
Which JavaScript library is used to create Desktop apps in Node.js?
React.js
React Native
Electron.js
Express.js
Which JavaScript library is used to create Progressive Web apps in Node.js?
React.js
React Native
Electron.js
Express.js
Node.js is a Closed-source Technology. True or False?
True
False
JavaScript used which of the following I/O model?
Non-Blocking I/O Model
Blocking I/O Model
None.
Node.js is _ Threaded language
Single
Multi
Dual
Which of the following command is used to run a node.js program?
node run main.js
node start main.js
start main.js
node main.js
Which of the following code will print "Hello" on the output screen?
print("Hello");
console.log(Hello);
console.log("Hello");
printf("%s","Hello");
What will be the output
var num = 10
console.log(num + 10)
20
83
None of these
Hello!
Who createad NPM (Node Package Manager)?
Isaac Z. Schlueter
Ryan Dahl
Brendan Eich
JSON was a native construct of which language?
PHP
Java
Ruby On Rails
Javascript
Who made node.js?
Hampton Catlin
Ryan Dahl
Isaac Z. Schlueter
GitHub
Module in Node.js is a simple or complex functionality organized in...
a single JavaScript file
single or multiple JavaScript files
the core built in functionality of Node.js
Node.js doesn't support modules functionality
How can you see all the dependencies for a Node.js app?
All the dependencies are listed down in the package.json file
By executing "npm i" and capturing the dependencies list
You can't have dependencies in a Node.js app
All the dependencies are listed down in the package-dependencies.json file
In Node.js, HTTP Basic Authentication is quite recommended due to its inherent security strongness
True
False
True, and also because it is a straightforward method
False, Node.js doesn't support basic authentication
Node.js is...
modular platform, meaning that much of the functionality is being built in to the platform
modular platform, meaning that much of the functionality is provided by external modules
modular platform, meaning that much of the functionality does not work without angular 2
modular what? I'm sorry, I wasn't paying attention
The reason Node.js uses event callbacks is
not to have to wait for blocking I/O
its creator didn't know how to use async/await
not to perform any I/O tasks from Node.js
to make it possible to work with promises
The "pending callbacks" phase of the event loop
grabs the top item in the event queue and executes it
executes callbacks scheduled by setTimeout() and setInterval()
retrieves new I/O events
executes I/O callbacks deferred to the next loop iteration
When did Ryan Dahl authored Node.js?
2007
2008
2009
2010
Which of the following command is used to run a node.js program?
node run main.js
node start main.js
start main.js
node main.js
Node.js is _ Threaded language
Single
Multi
Dual
Can we execute JavaScript code outside a web browser?
Yes sure
No, because it’s a programming language used to develop Front-end and Back-end applications on the browser
Not sure
What is Node.Js?
A virtual machine software
A Database Development tool
A Runtime Environment
What is a runtime environment?
.An environment in which a program or application is executed
An environment where files can be saved
A Virtual Machine where other operating systems can run
________ is a back end web application framework for Node.js, it is fast, unopinionated and minimalist framework.
Emotional.js
Express.js
Nodemon
Doraemon
What module provides utilities for working with file and directory paths?
OS Module
Path Module
FS Module
HTTP Module
________ are the blocks of encapsulated code that communicates with an external application on the basis of their related functionality.
Application
Code
Dependencies
Modules
What module provides information about the computer's operating system?
OS Module
Path Module
FS Module
HTTP Module
What is the right syntax for importing a module?
require()
function()
import()
module.import()
What JavaScript Engine is used by Google Chrome?
Y8
Adobe Flash Player
Friv
V8
Which of the following command is used to run a node.js program?
node run main.js
node start main.js
start main.js
node main.js
_____is used to raise the event.
myEmitter.emitter()
myEmtter.emit()
myEmitter.event()
myEmitter.emitEvent()
Which of the following is correct syntax?
fs.writeFile("filename", data, callback);
fs.writeFile(data ,"filename", callback);
fs.writeFile(callback, data, "filename");
None
Which of the following is correct?
fs.unlink(path)
fs.unlinkSync(path)
fs.delete(path)
fs.deleteSync(path)
To check if a file exists, use
fs.accessFile()
fs.access()
Both
None
Which of the following asynchronously append data to a file
fs.append(path, data[, options])
fs.appendFile(path, data[, options])
fs.append(path, data[, options], callback)
fs.appendFile(path, data[, options], callback)
What is the advantage of using node.js?
Great concurrency
Generally fast
It provides an easy way to build scalable network programs
All of these
Which of the following areas, Node.js is not advised to be used?
Single Page Applications
JSON APIs based Applications
CPU intensive applications
Data Intensive Realtime Applications (DIRT)
3. Which of the following is an IF statement in JavaScript?
if i = 5
if i = 5 then
if (i == 5)
All of these
What will be the output of following code snippet?
JSON.stringify({ message: "Hello World"});
{message:Hello World}{message:Hello World}
{‘message’:’Hello World’}
{"message":"Hello World"}
None
What is a runtime environment?
.An environment in which a program or application is executed
An environment where files can be saved
A Virtual Machine where other operating systems can run
Can we execute JavaScript code outside a web browser?
Yes sure
No, because it’s a programming language used to develop Front-end and Back-end applications on the browser
Not sure
JavaScript used which of the following I/O model?
Non-Blocking I/O Model
Blocking I/O Model
None.
Which of the following command is used to run a node.js program?
node run main.js
node start main.js
start main.js
node main.js
Which of the following code will print "Hello" on the output screen?
print("Hello");
console.log(Hello);
console.log("Hello");
printf("%s","Hello");
Who made node.js?
Hampton Catlin
Ryan Dahl
Isaac Z. Schlueter
GitHub
When did Ryan Dahl authored Node.js?
2007
2008
2009
2010
What will be the output
var num = 10
console.log(num + 10)
20
83
None of these
Hello!
JSON was a native construct of which language?
PHP
Java
Ruby On Rails
Javascript
How can you see all the dependencies for a Node.js app?
All the dependencies are listed down in the package.json file
By executing "npm i" and capturing the dependencies list
You can't have dependencies in a Node.js app
All the dependencies are listed down in the package-dependencies.json file
Which is the correct syntax for Arrow Function?
->
<--!
=>
function arrow()
________ are the blocks of encapsulated code that communicates with an external application on the basis of their related functionality.
Application
Code
Dependencies
Modules
What module provides utilities for working with file and directory paths?
OS Module
Path Module
FS Module
HTTP Module
NodeJS is
Asynchronous
Synchronous
How Node.js modules are available externally
module.exports
module.spread
module.expose
none of these
What is Callback
It is a technique in which a function is executed after executing the calling function
Only calls a specific function
Node of these
Which of the following needs to be updated to achieve dynamic UI updates?
State
Props
React considers everything as _______.
User interface
elements
components
Objects
React is mainly for building _____________.
Database
Connectivity
User interface
Design platform
To connect Mongo dB Database from NodeJS which middleware we require?
Body-parser
Mongoose
Express
None of these
What are core features of Express framework?
Allows to set up middle-ware to respond to HTTP Requests
Defines a routing table which can works as per HTTP Method and URL
Dynamically render HTML Pages
All of the above
Which field is always first field in document?
Any field
id
_id
Objid
How to create a model?
Using Schema
Using model
Both Schema & model
None of these
Where we should specify the MongoDB collection name in NodeJS Code?
Anywhere in the NodeJS code
When we create Models Object in NodeJS
When we create the Model
Create Manually
REST API works between
Client (UI) --- Server(Express)
Server(Express) --- Mongoose
Mongoose --- MONGODB
None
Which Statement is TRUE
In a Project, Model Class and MongoDB Documents have same no of fields
In a Project, MongoDB Documents have more fields than Model Class fields
In a Project, MongoDB Documents have less fields than Model Class fields
Status Code 404 means resource not found
True
False
When was MongoDB created?
In January 2008
In February 2009
In March 2010
In April 2011
When was NPM created?
In January 2010
In August 2011
In February 2012
In April 2013
What platform popularized RESTful JSON API's?
Web Market
Mobile Game
Social Media
When was the first non-Beta version of node was released?
2014
2013
2015
2016
In which of the following areas, Node.js is not advised to be used?
Single Page Applications
JSON APIs based Applications
D - Data Intensive Realtime Applications (DIRT)
Answe
Data Intensive Realtime Applications (DIRT)
Which method of fs module is used to write a file?
fs.write(path, flags[, mode], callback)
fs.writeFile(path, flags[, mode], callback)
fs.writePath(path, flags[, mode], callback)
None of the above.
Which method of fs module is used to remove a directory?
fs.deleteDirectory(path[, mode], callback)
fs.rmdir(path, callback)
fs.removeDirectory(path[, mode], callback)
None of the above.
Which of the following is not a valid HTTP method?
get
put
post
header
NodeJs is ----------- by default
Synchronous
Asynchronous
multi-thread
none of the above
what is the default scope in NodeJs application
Global
Local
Global Function
Local to object
third party package can be install/update/delete using ---------
node package manager
Node.exe
Module.exports
REPL
how to import module in NodeJs?
Using the require() function
using module.exports
using the enclude() function
using the app.use() function
which of the following is used to create and consume custom events in NodeJs?
EventEmitter
Events
NodeEvent
None of the above
which module is used to serve static resources in nodejs?
node-static
http
node-resource
static
_____ is an interactive shell that processes Node.
REPL
REAL
RESP
None of the above
What is the full form of REPL?
Read Eval Print Loop
Research Eval Program Learn
Read Earn Print Learn
which node module used to handle binary data
binary
buffer
crypto
dgram
what happens when you click the rendred button?
Nothing
The rendred button whithin Button will change to Jack
infinite Loop
Which of the following is the correct way to rewrite this using useState?
const [count, setCount] = useState(0)
count [count, setCount] = useState(0)
const setCount = useState(0)
const setCount = useState()
Which of the following is NOT true of hooks?
hooks allows the conversion of class components to functional components
hook can not be used inside loops
hooks can be used whithin class components
you can make you own custom hooks
The following React code renders a button where the button text is generated through an inefficient function that takes the variable mult as an argument. The variable mult is set whenever value is a multiple of 5. What can you add to this function to make the rerenders less costly?
Assume no variables can be removed and you do not have access to source code of someCodeThatTakesLongTime.
write you own version of someCodeThatTakesLongTime that is faster
make an {a} into a state variable and set it when value changes
use useMemo to only compute when the value of mult change
How many times will the console print Hello?
once every time the compnents update
only once
Zero
Asynchronous functions can trigger the callback of the catch part using what keyword?
return
throw
await
await
What global variable is used to access the environment variables of a NodeJS application?
env
ENV
process.env
Process.getEnv()
HTTPS is
Hypertext transfer protocol secure (HTTPS) is the secure version of HTTP, which is the primary protocol used to send data between a web browser and a website
Hypertext transfer primary secure (HTTPS) is the secure version of HTTP, which is the primary protocol used to send data between a web browser and a website
Can I drop off the meeting now?
filters the document stream to allow only matching documents to pass unmodified into the next pipeline stage
$regex
$reg
$match
none of the mentioned
the ................. method limits the number of documents in the result set?
limit()
limitOf()
limitBy()
none of the montioned
which of the following line skips the first 5 documents in the bios collection and returns all remaining documents?
db.bios.find.limit(5)
db.bios.find.skip(1)
db.bios.find.skip(5)
db.bios.find.sort(5)
React component can return how many html tags
one
multiple
two
three
const [x, y] = useState(0) -> what is the y
Setter function
Getter function (state variable)
what is the output
[[1, 2, 3, 4, 5]]
[1, 2, 3, 4, 5]
1
[1]
How is a Middleware built?
app.use(<PATH>, (req, res) => {
// validations
});
app.use(<PATH>, (req, res, next) => {
// validations
next()
});
app.middleware(<PATH>, (req, res, next) => {
// validations
next()
});
app.middleware(<PATH>, (req, res) => {
// validations
});
Which one of the following argument is used to call next middle ware in stack?
req
res
next
get
useEffect(() => { setDone(true); });
useEffect(() => { setDone(true); }, []);
useEffect(() => { setDone(true); }, [setDone]);
useEffect(() => { setDone(true); }, [done, setDone]);
Remove this
Capitalize clock
Remove the render method
Add quotes around the return value
Why might you use a ref?
to directly access the DOM node
to refer to another JS file
to bind the function
to call a function
{{name: "Venkat", age: 30}}
{name: "Venkat", age: 30}
{person: "Venkat", person: 30}}
{person: {name: "Venkat", age: 30}}
Error. Cannot use direct JavaScript code in JSX
Error. Should be replaced with a for..loop for correct output
Displays the list of languages in the array
Displays nothing
What does this React element look like given the following function?
React.createElement('h1', null, "What's happening?");
<h1 props={null}>What's happening?</h1>
<h1>What's happening?</h1>
<h1 id="component">What's happening?</h1>
<h1 id="element">What's happening?</h1>
How do you write an inline style specifying the font-size:12px and color:red; in JSX?
style={{font-size:12,color:'red'}}
style={{fontSize:'12px',color:'red'}}
style={fontSize:'12px',color:'red'}
style={{font-size:12px,color:'red'}}
How can you see all the dependencies for a Node.js app?
All the dependencies are listed down in the package.json file
By executing "npm i" and capturing the dependencies list
You can't have dependencies in a Node.js app
All the dependencies are listed down in the package-dependencies.json file
In Node.js, HTTP Basic Authentication is quite recommended due to its inherent security strongness
True
False
True, and also because it is a straightforward method
False, Node.js doesn't support basic authentication
The reason Node.js uses event callbacks is
not to have to wait for blocking I/O
its creator didn't know how to use async/await
not to perform any I/O tasks from Node.js
to make it possible to work with promises
The "pending callbacks" phase of the event loop
grabs the top item in the event queue and executes it
executes callbacks scheduled by setTimeout() and setInterval()
retrieves new I/O events
executes I/O callbacks deferred to the next loop iteration
What is the buffer in Node.js?
Memory allocated outside V8 to store raw binary data
In-memory location inside V8 used for streaming
Client side storage used to store local data
What are streams in Node.js
process of flow of data from source to buffer
a raw memory storage for streaming data
transport channels for tcp/ip sockets
What is not built-in node module?
util
os
zlib
express
Streams are similar to event emitters?
true
false
How many types of streams are there?
3, readable, writeable and both
2, readable, writeable
1 read only
Which of the following code can create a web server ?
A. http.createServer(callback)
B. http.createWebServer(callback)
C. http.createHTTPServer(callback)
D. None of the above
Which of the following is true about fs module of Node?
A. Every method in fs module have synchronous as well as asynchronous form
B. Asynchronous methods of fs module take last parameter as completion function callback and first parameter of the callback function as error
C. Both of the above
D. None of the above
Which method of fs module is used to read a file?
A - fs.open(path, flags[, mode], callback)
B - fs.openFile(path, flags[, mode], callback)
C - fs.openPath(path, flags[, mode], callback)
D - fs.read(fd, buffer, offset, length, position, callback)
Where is captured values are populated regarding route parameters?
req.params object
app.locals object
req.data object
none of the above
