MongoDB Quiz - MCQ - Multiple Choice Questions
Q. What is MongoDB?
A. A relational database management systemB. An object-oriented database
C. A document-oriented NoSQL database
D. A graph database
Q. What type of data model does MongoDB use?
A. Key-value modelB. Document model
C. Graph model
D. Relational model
Q. How does MongoDB handle relationships between data?
A. By using foreign keys and joinsB. Through embedded documents and references
C. With indexes and links
D. By utilizing graph structures
Q. What is a collection in MongoDB?
A. A set of documents with similar structureB. A grouping of related tables
C. A unique identifier for a document
D. A database index
Q. How does MongoDB ensure data consistency?
A. Through transactions and ACID complianceB. By using eventual consistency
C. With document locking
D. Through replication and write concerns
Q. What is sharding in MongoDB?
A. Distributing data across multiple machines for scalabilityB. A technique for data compression
C. A method for securing data with encryption
D. A process of optimizing query performance
Q. How does MongoDB handle schema design?
A. With a rigid schema defined upfrontB. Through a flexible schema that can evolve over time
C. By dynamically creating a schema based on data
D. With a user-defined schema for each collection
Q. What is the role of the MongoDB Query Language (MQL)?
A. To perform complex queries and aggregationsB. To define indexes and optimize query performance
C. To manage security and access control
D. To handle data replication and sharding
Q. How does MongoDB handle data replication?
A. Through master-slave replicationB. By using multi-master replication
C. With asynchronous replication
D. All of the above
Q. What is a replica set in MongoDB?
A. A group of MongoDB instances that hold the same data setB. A configuration for sharding data across multiple machines
C. A set of indexes used for optimizing query performance
D. A security feature that encrypts data at rest
Q. How does MongoDB handle data indexing?
A. Through unique indexes on primary keysB. By allowing custom indexes on any field or combination of fields
C. With automatically generated indexes for frequently queried fields
D. All of the above