0% found this document useful (0 votes)
12 views11 pages

MCQ Que Bank FS

The document consists of multiple-choice questions and answers covering key concepts of Node.js and MongoDB. Topics include Node.js runtime environment, event-driven architecture, asynchronous programming, MongoDB data storage, and Express.js functionalities. It serves as a study guide for understanding the fundamental aspects of these technologies.

Uploaded by

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

MCQ Que Bank FS

The document consists of multiple-choice questions and answers covering key concepts of Node.js and MongoDB. Topics include Node.js runtime environment, event-driven architecture, asynchronous programming, MongoDB data storage, and Express.js functionalities. It serves as a study guide for understanding the fundamental aspects of these technologies.

Uploaded by

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

Unit I

1. Node.js is a __________ runtime environment.


A) Python
B) JavaScript
C) Ruby
D) Java
Answer: B) JavaScript

2. Node.js follows an __________ architecture.


A) Client-server
B) Event-driven
C) Microservices
D) Layered
Answer: B) Event-driven

3. A major advantage of Node.js is __________ due to its non-blocking I/O.


A) Security
B) Scalability
C) Flexibility
D) Speed
Answer: B) Scalability

4. In Node.js, __________ programming blocks code execution until the current task is completed, while
__________ allows non-blocking execution.
A) Synchronous, asynchronous
B) Asynchronous, synchronous
C) Parallel, sequential
D) Blocking, non-blocking
Answer: A) Synchronous, asynchronous

5. The purpose of a callback function in Node.js is to __________ only after a specified task completes.
A) halt the execution
B) execute a function
C) return an error
D) display a message
Answer: B) execute a function

6. A __________ is a mechanism to handle asynchronous operations and avoid callback hell in Node.js.
A) Promise
B) Callback
C) Generator
D) Async function
Answer: A) Promise

7. The method used to interact with MongoDB in a Node.js application is __________.


A) mongo.connect()
B) mongoose.connect()
C) node.connect()
D) mongodb.connect()
Answer: B) mongoose.connect()
8. In Node.js, a schema is defined using __________.
A) mongoose.Schema()
B) mongoose.Model()
C) mongodb.Schema()
D) node.Schema()
Answer: A) mongoose.Schema()

9. The HTTP method used to update data on a server in a REST API is __________.
A) GET
B) POST
C) PUT
D) DELETE
Answer: C) PUT

10. The purpose of JSON Web Token (JWT) in Node.js authentication is to __________ securely transmit user
information between the server and client.
A) securely
B) store
C) encrypt
D) log
Answer: A) securely
Unit II

1. The purpose of the __________ in Node.js is to expose functions, objects, or variables to be used in other files.
A) module.require

B) module.exports

C) module.import

D) module.load

Answer: B) module.exports

2. The method used to read a file asynchronously in Node.js is __________.


A) fs.open()

B) fs.readFileSync()

C) fs.readFile()

D) fs.createReadStream()

Answer: C) fs.readFile()

3. The __________ class in Node.js is used to handle binary data.


A) Buffer

B) String

C) FileStream

D) ArrayBuffer

Answer: A) Buffer

4. A __________ module in Node.js is available by default without any installation.


A) Core

B) Local

C) Third-party

D) External

Answer: A) Core

5. To install a package globally using npm, you use the command npm install ________ <package-name>.
A) -g

B) --save

C) --global

D) -local

Answer: A) -g

6. An example of a Local Module in Node.js is __________.


A) fs

B) http

C) myModule.js

D) path

Answer: C) myModule.js

7. The method used to create a new directory in Node.js is fs.__________().


A) mkdirSync()

B) createDir()

C) dirSync()

D) fs.createDir()

Answer: A) mkdirSync()

8. The method used to delete a file in Node.js is fs.__________().


A) unlinkSync()

B) deleteFile()

C) unlink()

D) remove()

Answer: C) unlink()

9. The __________ class in Node.js helps you to handle events and listeners.
A) Http

B) EventEmitter

C) EventListener

D) Stream
Answer: B) EventEmitter

10. The method used to bind a function to an event in Node.js is eventEmitter.__________().


A) emit()

B) on()

C) addListener()

D) bind()

Answer: B) on()
Unit III

1. MongoDB is a type of __________ database.

A) Relational

B) NoSQL

C) Hierarchical

D) Object-oriented
Answer: B) NoSQL

2. In MongoDB, data is stored in __________, which are similar to tables in RDBMS.

A) Rows

B) Collections

C) Databases

D) Records

Answer: B) Collections

3. In MongoDB, the basic unit of data storage is called a __________.

A) Table

B) Record

C) Row

D) Document

Answer: D) Document

4. The structure used to store data in MongoDB is typically in the form of __________.

A) XML

B) JSON

C) CSV

D) HTML

Answer: B) JSON

5. To filter specific data in MongoDB, we use __________ queries.

A) Search
B) Filter

C) Select

D) Find

Answer: B) Filter

6. A collection in MongoDB is equivalent to a __________ in a relational database.

A) Table

B) Record

C) Column

D) View

Answer: A) Table

7. One of the key benefits of NoSQL databases like MongoDB is __________ scalability.

A) Vertical

B) Horizontal

C) Static

D) Dynamic

Answer: B) Horizontal

8. In MongoDB, an embedded document is typically stored within a __________.

A) Table

B) Collection

C) Document

D) Row

Answer: C) Document

9. The process of creating an index to speed up queries in MongoDB is called __________.

A) Indexing

B) Sorting

C) Partitioning
D) Filtering

Answer: A) Indexing

10. The MongoDB command line interface is known as the __________.

A) Mongo Shell

B) Mongo Client

C) Mongo CLI

D) Mongo Query

Answer: A) Mongo Shell


Unit IV

1. In MongoDB, a __________ design pattern is used to organize data for optimal performance and
scalability.

A) Singleton

B) Schema

C) Factory

D) Observer

Answer: B) Schema

2. MongoDB's __________ storage class is used to automatically manage disk storage for large datasets.

A) External

B) Register

C) Automatic

D) Static

Answer: C) Automatic

3. The __________ storage class in C/C++ is used to store variables in a fixed memory location during the
program's lifetime.

A) Static

B) Register

C) Automatic

D) External

Answer: A) Static

4. In MongoDB, __________ is the process of breaking data into smaller, more manageable pieces across
multiple servers.

A) Replication

B) Sharding

C) Indexing

D) Partitioning
Answer: B) Sharding

5. One of the main goals of the Aggregation Framework in MongoDB is to process data in a __________.

A) Loop

B) Table

C) Pipeline

D) Matrix

Answer: C) Pipeline

6. In MongoDB, __________ indexes are used to improve the performance of queries by enabling faster
access to data.

A) Hash

B) Performance

C) B-tree

D) Composite

Answer: B) Performance

7. In Express.js, __________ are used to define specific actions for handling HTTP requests for different
routes.

A) Handlers

B) Views

C) Routes

D) Controllers

Answer: C) Routes

8. In Express.js, middleware functions can be used for tasks such as __________, authentication, and
logging.

A) Routing

B) Validation

C) Template rendering

D) File serving

Answer: B) Validation
9. Express.js allows you to integrate and use __________ engines to dynamically render HTML content.

A) Static

B) Rendering

C) Templating

D) Routing

Answer: C) Templating

10. To serve static files, such as images or CSS, in Express.js, you would use the __________ middleware.

A) Static

B) Dynamic

C) Middleware

D) File

Answer: A) Static

You might also like