0% found this document useful (0 votes)
155 views3 pages

Mcq's

The document contains 12 multiple choice questions about Node.js concepts. The questions cover topics like why Node.js code is fast, how to check the npm version, what Node.js is, required modules, HTTP protocols, WebSocket events, closing WebSockets, npm installation defaults, stream errors, callbacks, and creating web servers. The answers to each question are provided at the end.

Uploaded by

Maha Awan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
155 views3 pages

Mcq's

The document contains 12 multiple choice questions about Node.js concepts. The questions cover topics like why Node.js code is fast, how to check the npm version, what Node.js is, required modules, HTTP protocols, WebSocket events, closing WebSockets, npm installation defaults, stream errors, callbacks, and creating web servers. The answers to each question are provided at the end.

Uploaded by

Maha Awan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

MCQS:

1. Why code written in Node.JS is pretty fast although being written in


JavaScript?
(a) Node.JS internally converts JavaScript code to Java based code and then execute the same.
(b) Node.JS internally converts JavaScript code to C based code and then execute the same.
(c) Being built on Google Chrome's V8 JavaScript Engine.
(d) None of the above.

2.Which of the following command will show version of npm?


(a) $ npm --version

(b) $ node --version

(c) $ npm get Version

(d) $ node getVersion

3. What is Node.JS?
(a) Node.js is a web server.
(b) Node.js is a JavaScript based framework/platform built on Google Chrome's JavaScript
V8 Engine.
(c)Node.js is a java based framework.
(d) None of the above.

4. Which of the following module is required for path specific operations?


(a)os module

(c) path module

(b) fs module

(d)None of the above.

5.Which of the following is a stateless protocol?

(a)HTML
(b)XHTML
(c)HTTP
(d)All of the mentioned

6.How many WebSocket events are available?


(a)2

(b)3

(c)4

(d)5

7.Which method is used to close the WebSocket?


(a)Socket.flush()
(b)Socket.close()
(c)Socket.Close()
(d)Socket.dispose()

8.Which of the following is not a WebSocket event?

(a)open
(b)close
(c)error
(d)deny

9.By default, npm installs any dependency in the global mode.


(a) true
(b) false

10. A stream fires error event when there is any error receiving or writing
data.

(a) false
(b) true

11. What is Callback?


(a) Callback is an asynchronous equivalent for a function.
(b) Callback is a technique in which a method call back the caller method.
(c) Both of the above.
(d) None of the above.

12.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.

Answers:
1.C 2.A 3.B 4.C 5.C 6.C 7.B 8.D 9.A 10.B

11.A 12.B

You might also like