Node.js Quiz | Set-3

  • Last Updated : 30 Sep, 2021


12
Question 1
Which below module is used to get end-of-line character as specified by the operating system ?
A
os.EOL
B
os.endianness()
C
os.cpus()
D
os.arch()
Node.js Quiz | Set-3    
Discuss it


Question 1 Explanation: 
The os.EOL comes with an os module which is used to get an end-of-line character or marker as specified by the operating system. It returns the end of the line marker.
Question 2
Which method in Node.js are used to get system uptime in seconds ?
A
os.freemem()
B
os.uptime()
C
os.getPriority()
D
os.homedir()
Node.js Quiz | Set-3    
Discuss it


Question 2 Explanation: 
The os.uptime() is the method in Node.js that is used to get system uptime in seconds. This method does not accept any parameters.
Question 3
How do we get the filename portion of a path to the file in Node.js ?
A
path.extname()
B
path.basename()
C
path.dirname()
D
path.delimiter
Node.js Quiz | Set-3    
Discuss it


Question 3 Explanation: 
The path.basename() method in node.js is used to get the filename portion of a path to the file. This directory was ignored when using this method. It takes a two-parameter as path and extension.
Question 4
Which below in Node.js are used to join a number of path segments ?
A
path.argv()
B
path.join()
C
path.chdir()
D
path.argv()
Node.js Quiz | Set-3    
Discuss it


Question 4 Explanation: 
The path.join() is used to join a number of path segments using the platform-specific delimiter to form a single path. The final path joining takes place. It takes comma-separated values.
Question 5
Which below method is responsible for parsing and formatting URL query strings ?
A
Query
B
String decoder
C
steam
D
VM
Node.js Quiz | Set-3    
Discuss it


Question 5 Explanation: 
The Query String is used as utilities for parsing and formatting URL query strings.
Question 6
Which data-handling method and is used to read or write input into output sequentially ?
A
Utility
B
Timer
C
Decoder
D
Stream
Node.js Quiz | Set-3    
Discuss it


Question 6 Explanation: 
Streams are the data-handling method and it is used to read or write input into output as sequence manner. The main advantage of Streams is used to handle reading or writing the files.
Question 7
Which method is used to return all the remaining input stored in the internal buffer as a string ?
A
stringDecoder.start()
B
stringDecoder.end()
C
stringEncoder.start()
D
stringEncoder.end()
Node.js Quiz | Set-3    
Discuss it


Question 7 Explanation: 
The stringDecoder.end() is a method that is used to return the input stored into the buffer as string format.
Question 8
Which method finds the maximum number of sockets that will be left open in the free state ?
A
agent.minFreeSockets
B
agent.maxFreeSockets
C
agent.maxSockets
D
agent.minSockets
Node.js Quiz | Set-3    
Discuss it


Question 8 Explanation: 
The agent.maxFreeSockets is used to sets the maximum number of sockets that will be open in the free state. This node does not accept any parameters.
Question 9
Which property is used to yields an object listing Zlib-related constants ?
A
zlib.constants()
B
zlib.createBrotliDecompress()
C
zlib.createUnzip()
D
zlib.createBrotliCompress()
Node.js Quiz | Set-3    
Discuss it


Question 9 Explanation: 
The zlib.constants property is used to yields an object listing Zlib-related constants. It returns all the Zlib-related constants.
Question 10
Which v8 method is used to serialize any type of data into a buffer using default serializer ?
A
v8.Serializer.writeValue()
B
v8.Serializer.writeHeader()
C
v8.serialize()
D
v8.deserialize()
Node.js Quiz | Set-3    
Discuss it


Question 10 Explanation: 
The v8.serialize() is a method in node.js that is used to serialize any type of data into the default serializer. It takes the parameter as a value.
There are 15 questions to complete.
12
My Personal Notes arrow_drop_up


Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.