MCQ Que Bank FS
MCQ Que Bank FS
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
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
B) fs.readFileSync()
C) fs.readFile()
D) fs.createReadStream()
Answer: C) fs.readFile()
B) String
C) FileStream
D) ArrayBuffer
Answer: A) Buffer
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
B) http
C) myModule.js
D) path
Answer: C) myModule.js
B) createDir()
C) dirSync()
D) fs.createDir()
Answer: A) mkdirSync()
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
B) on()
C) addListener()
D) bind()
Answer: B) on()
Unit III
A) Relational
B) NoSQL
C) Hierarchical
D) Object-oriented
Answer: B) NoSQL
A) Rows
B) Collections
C) Databases
D) Records
Answer: B) Collections
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
A) Search
B) Filter
C) Select
D) Find
Answer: B) Filter
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
A) Table
B) Collection
C) Document
D) Row
Answer: C) Document
A) Indexing
B) Sorting
C) Partitioning
D) Filtering
Answer: A) Indexing
A) Mongo Shell
B) Mongo Client
C) Mongo CLI
D) Mongo Query
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