Bits - VAC
Bits - VAC
- A) Relational Database
- B) Key-Value Database
- C) Document-Oriented Database
- D) Graph Database
- A) JSON
- B) BSON
- C) XML
- D) CSV
- A) Table
- B) Row
- C) Column
- D) Index
- A) db.createDatabase("database_name")
- B) use database_name
- D) database.new(database_name)
5. Which of the following MongoDB methods is used to insert a single document into a collection?
- A) db.collection.insertOne()
- B) db.collection.insert()
- C) db.collection.addDocument()
- D) db.collection.addOne()
6. Which of the following is NOT a supported data type in MongoDB?
- A) Array
- B) Integer
- C) Date
- D) Double-Array
- A) db.collection.retrieve()
- B) db.collection.find()
- C) db.collection.query()
- D) db.collection.getAll()
- A) db.drop(collection_name)
- B) db.collection.delete()
- C) db.collection.drop()
- D) db.removeCollection(collection_name)
- C) To encrypt data
- D) To create backups
- A) Primary Key
- B) Document Key
- C) _id Field
- D) Object Identifier
- B) As structured documents
12. Which data format is commonly used by MongoDB to represent documents internally?
- A) XML
- B) BSON
- C) CSV
- D) YAML
13. In MongoDB, each document within a collection must contain which unique field?
- A) _document_id
- B) uniqueKey
- C) _id
- D) docID
14. What is a key benefit of using the document model for data storage?
15. In the document model, relationships between data are often represented by:
- D) Indexing tables
16. Which of the following statements is true about MongoDB’s document model?
18. What is one disadvantage of using embedded documents for nested data in MongoDB?
- A) Increases performance
19. Which MongoDB feature allows documents to be retrieved based on their structure?
- A) Schemas
- B) Joins
- C) Indexes
- D) Aggregations
20. In MongoDB, which structure would best represent a “one-to-many” relationship within the
document model?
- A) Embedding multiple documents within a single document
21. What type of architecture does MongoDB use to ensure high availability and scalability?
- A) Master-Slave
- B) Client-Server
- D) Centralized
23. Which of the following is a primary component of MongoDB’s architecture that helps distribute data
across multiple servers?
- A) Indexing
- B) Sharding
- C) Aggregation
- D) Caching
- A) Arbiter
- B) Config Server
- C) Secondary Node
- D) Router
27. Which MongoDB component is responsible for routing requests to the appropriate shard?
- A) Config Server
- C) Primary Node
- D) Aggregator
28. How does MongoDB ensure data consistency across a replica set?
29. In a sharded cluster, which component stores the metadata of the shards?
- A) Primary Node
- C) Config Server
- D) Arbiter
30. Which MongoDB process is used to manage sharded data across multiple shards?
- A) mongos
- B) mongo
- C) mongod
- D) mongoexport
31. Which of the following is a key feature of MongoDB that supports a flexible data structure?
- B) Document-oriented storage
33. Which MongoDB feature allows it to scale horizontally across multiple servers?
- A) Replication
- B) Indexing
- C) Sharding
- D) Aggregation
- A) Relational model
- B) Hierarchical model
- C) Key-Value model
- D) Document model
35. In MongoDB, which feature ensures high availability by maintaining multiple copies of data?
- A) Sharding
- B) Aggregation
- C) Replication
- D) Indexing
36. Which feature in MongoDB allows developers to perform complex data transformations and
computations on data within a single query?
- A) Indexing
- B) Aggregation framework
- C) Sharding
- D) Clustering
37. MongoDB's capability to store arrays and sub-documents within documents is referred to as:
- B) Hierarchical storage
- C) Embedded documents
- D) Normalization
38. Which MongoDB feature allows users to conduct text searches within documents?
- A) GridFS
- B) Text indexing
- C) Aggregation
- D) Sharding
39. What feature of MongoDB enables developers to perform CRUD operations on large files and store
files larger than the BSON document size limit?
- A) Replication
- B) GridFS
- C) Sharding
- D) Aggregation
- A) db.createDatabase("database_name")
- B) use database_name
- D) db.newDatabase("database_name")
43. Which command explicitly creates a collection with specific options in MongoDB?
- A) db.createCollection("collection_name", options)
- B) db.collection.create("collection_name", options)
- A) db.showCollections()
- B) db.listCollections()
- C) show collections
45. What happens if you attempt to use a database in MongoDB that doesn’t yet exist?
46. Which of the following options can be specified when creating a collection with
db.createCollection()?
- B) Encryption type
- D) File format
- A) db.deleteDatabase()
- C) db.dropDatabase()
- A) drop collection_name
- B) db.dropCollection("collection_name")
- C) db.collection_name.drop()
- D) delete collection_name
49. Which command in MongoDB switches the context to an existing or new database?
- A) use
- B) switch
- C) select
- D) load
50. How can you check the name of the currently selected database in MongoDB?
- A) db.getCurrentDatabase()
- B) db
- C) show db
- D) db.database()
51. Which command is used to insert a single document into a MongoDB collection?
- A) db.collection.addOne()
- B) db.collection.insertOne()
- C) db.collection.save()
- D) db.collection.insertMany()
- A) db.collection.insertMany()
- B) db.collection.insertMultiple()
- C) db.collection.saveAll()
- D) db.collection.addMany()
- B) db.collection.show()
- C) db.collection.find()
- D) db.collection.getAll()
54. To read a single document matching a specific criterion from a collection, which method would you
use?
- A) db.collection.findOne()
- B) db.collection.findSingle()
- C) db.collection.searchOne()
- D) db.collection.getOne()
55. Which operator is used to update specific fields in a document without replacing the entire
document?
- A) $replace
- B) $modify
- C) $set
- D) $update
56. What method is used to update one document that matches a specific query in MongoDB?
- A) db.collection.updateOne()
- B) db.collection.updateSingle()
- C) db.collection.modifyOne()
- D) db.collection.replaceOne()
57. If you want to update multiple documents matching a specific condition, which method would you
use?
- A) db.collection.modifyMany()
- B) db.collection.updateAll()
- C) db.collection.updateMany()
- D) db.collection.update()
58. Which MongoDB method is used to delete a single document matching a query?
- A) db.collection.deleteOne()
- B) db.collection.removeOne()
- C) db.collection.dropOne()
- D) db.collection.eraseOne()
59. To delete all documents in a collection that match a specified condition, which method is used?
- A) db.collection.drop()
- B) db.collection.deleteMany()
- C) db.collection.remove()
- D) db.collection.eraseAll()
60. What will happen if you use the db.collection.updateOne() method without any update operator like
$set?
61. Which method is used in MongoDB to retrieve documents from a collection that match specific
criteria?
- A) db.collection.get()
- B) db.collection.search()
- C) db.collection.find()
- D) db.collection.retrieve()
62. What operator is used in MongoDB to match documents where a field is equal to a specific value?
- A) $eq
- B) $equals
- C) $match
- D) $find
63. How would you write a query to find documents in a collection where the field "age" is greater than
18?
- A) { age: { $gt: 18 } }
- B) { age: { $gte: 18 } }
- C) { age: { $lt: 18 } }
- D) { age: { $gt 18 } }
64. Which operator is used in MongoDB to check if a field’s value exists in an array of specified values?
- A) $in
- B) $exists
- C) $match
- D) $array
65. To retrieve only specific fields from a document, which part of the find() method is used?
- A) Sorting
- B) Projection
- C) Filtering
- D) Indexing
66. What does the MongoDB query { status: { $ne: "complete" } } do?
- A) $in
- B) $or
- C) $and
- D) $match
68. What does the query { "score": { $gte: 70, $lte: 90 } } find?
69. Which query would find all documents where the "tags" field contains both "science" and
"technology"?
- A) Front-end development
- B) Game development
- C) Back-end server-side development
- D) Database management
- A) Python
- B) JavaScript
- C) Java
- D) Ruby
- A) Chakra
- B) SpiderMonkey
- C) V8
- D) Rhino
- C) Multi-threaded
- D) Procedural
75. Which module in Node.js allows for managing HTTP requests and responses?
- A) fs
- B) events
- C) http
- D) path
77. Which of the following is a key feature of Node.js that makes it suitable for data-intensive real-time
applications?
- A) Multi-threading
- B) Event-driven architecture
- D) Strict typing
78. How does Node.js handle multiple connections at the same time?
79. Which of the following commands is used to initialize a new Node.js project and create a
package.json file?
- A) node init
- B) npm start
- C) npm init
- D) node start
80. Which of the following features allows Node.js to handle high concurrency without high memory
consumption?
- A) Multi-threading
- B) Non-blocking I/O
- C) Synchronous processing
- A) node --version
- B) npm --install
- C) node install
- D) npm check
- D) Creating databases
83. Which command would you use to install a package globally in Node.js?
84. What file is created to manage project dependencies when you initialize a Node.js project with npm
init?
- A) node_modules.json
- B) npm.json
- C) package.json
- D) project.json
85. Which command is used to install all dependencies listed in a package.json file?
- A) npm install
- B) npm start
- C) npm init
- D) node install
86. To remove an installed package from a project, which npm command would you use?
87. What command is used to create a package.json file with default settings in Node.js?
- A) npm init
- B) npm init -y
89. What does the caret (^) symbol mean in the version number of a dependency in package.json?
- C) Update to the latest minor or patch version, but not a major version
90. Which npm command would you use to update all project dependencies to their latest versions?
- A) npm update
- B) npm upgrade --all
- A) Multi-threaded
- B) Single-threaded
- C) Dual-threaded
- D) Threadless
93. Which of the following allows Node.js to handle I/O operations without blocking the main thread?
- A) Event loop
- B) Synchronous calls
- C) Call stack
- D) Data stream
95. Which module provides the functionality to work with child processes in Node.js?
- A) fs
- B) child_process
- C) events
- D) process
96. What method in the child_process module allows the creation of a new Node.js process?
- A) spawn()
- B) fork()
- C) exec()
97. Which Node.js function is used to end the process and exit?
- A) exit()
- B) process.exit()
- C) quit()
- D) endProcess()
- A) Successful termination
- B) Unsuccessful termination
- C) Unknown status
99. How does Node.js handle CPU-bound tasks effectively, given its single-threaded nature?
- A) A built-in database
- A) import()
- B) include()
- C) require()
- D) use()
- A) path
- B) fs
- C) os
- D) http
- A) express
- B) mongodb
- C) http
- D) lodash
- C) install module_name
107. What command is used to export a function in a module so that it can be used in other files?
- A) module.include = functionName
- B) module.import = functionName
- C) module.exports = functionName
- D) export functionName
109. Which of the following is true about the require function in Node.js?
- A) require('./module_name')
- B) require('module_name')
- C) import module_name
- D) include module_name
113. In JavaScript, which feature enables asynchronous behavior by executing code after a specified
delay?
- A) setInterval
- B) setTimeout
- C) clearTimeout
- D) executeLater
114. Which of the following is NOT a method for handling asynchronous operations in JavaScript?
- A) Callbacks
- B) Promises
- C) Threads
- D) Async/await
118. What keyword is used to pause the execution of a function until a Promise is resolved in JavaScript?
- A) await
- B) defer
- C) stop
- D) async
119. When using async and await, what type of function must the await keyword be used within?
- A) A standard function
- B) An async function
- D) A constructor function
- C) Asynchronous programming allows multiple tasks to be initiated without waiting for other tasks to
finish.