We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies. Learn More
contact@techquestworld.com
+919547614783

MCQ Questions

Browse through our collection of questions with detailed explanations

1

How to export a function in Node.js?

NodeJS Tutorials & Blogs
A module.exports = myFunction;
B export myFunction;
C include(myFunction);
D expose(myFunction);
Explanation

module.exports is used to export functions/objects.

2

What does the 'fs' module stand for?

NodeJS Tutorials & Blogs
A File System
B File Storage
C File Stream
D Fast Storage
Explanation

fs is used to handle file system operations.

3

What is npm?

NodeJS Tutorials & Blogs
A Node processor module
B Node program manager
C Node package manager
D Network package module
Explanation

npm helps manage Node.js packages and dependencies.

4

Which file extension is used for Node.js modules?

NodeJS Tutorials & Blogs
A .java
B .nodejs
C .js
D .mod
Explanation

Node modules are written in .js files.

5

Which method is used to create a server in Node.js?

NodeJS Tutorials & Blogs
A http.listen()
B http.createServer()
C http.connect()
D server.create()
Explanation

http.createServer() creates a new web server.

6

Which of the following is true about Node.js?

NodeJS Tutorials & Blogs
A Asynchronous and single-threaded
B Synchronous and multi-threaded
C Only for frontend use
D Compiled language
Explanation

Node.js is asynchronous and single-threaded.

7

Which object is used to handle events in Node.js?

NodeJS Tutorials & Blogs
A EventObject
B EventEmitter
C EventsHandler
D EventNode
Explanation

EventEmitter is part of the events module.

8

Which function is used to import a module in Node.js?

NodeJS Tutorials & Blogs
A require()
B include()
C import()
D load()
Explanation

require() loads built-in, local or 3rd-party modules.

9

Which of the following is not a Node.js core module?

NodeJS Tutorials & Blogs
A fs
B express
C path
D events
Explanation

express is a third-party framework, not built-in.

10

Node.js is best suited for...

NodeJS Tutorials & Blogs
A CPU-intensive applications
B I/O-bound applications
C Video processing
D Blockchain development
Explanation

Node is single-threaded, so it's ideal for non-blocking, I/O-heavy tasks.

11

Which module is used to create a web server in Node.js?

NodeJS Tutorials & Blogs
A url
B http
C net
D fs
Explanation

http module helps create HTTP server and handle requests/responses.

12

Node.js is built on which JavaScript engine?

A Chakra
B SpiderMonkey
C V8
D Rhino
Explanation

V8 is Google's open-source JS engine used in Chrome and Node.js.

13

What is Node.js?

NodeJS Tutorials & Blogs
A JavaScript framework
B JavaScript library
C JavaScript runtime
D Java compiler
Explanation

Node.js is a runtime built on Chrome's V8 engine for running JS on the server side.

14

Which method converts a JSON string to a JavaScript object?

A JSON.stringify()
B JSON.parse()
C JSON.objectify()
D JSON.decode()
Explanation

JSON.parse() takes a JSON string and turns it into a JS object.

15
What is the result of the following expression? 
console.log(0.1 + 0.2 === 0.3);
A true
B false
C NaN
D undefined
Explanation

Due to floating-point precision, 0.1 + 0.2 results in 0.30000000000000004, not exactly 0.3.