




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































MongoDB Certified Developer Associate Exam 2026: Professional Certification Practice Test — CRUD Operations, Data modelling, Aggregation Pipelines, Indexing, Transactions & Performance Optimization — 190 Multiple-Choice Questions with Answers & Detailed Rationales
Practice Examination — 190 Questions
Question 1
Which MongoDB component is responsible for storing the actual data on disk?
A. mongos router
B. Config server
C. mongod process
D. Application driver
Correct Answer: C
Explanation: The mongod process is the primary daemon that stores data, manages collections, and handles read/write operations on disk.
Question 2
In a MongoDB replica set, which node accepts write operations by default?
A. Secondary node
B. Arbiter node
C. Primary node
D. Hidden node
Correct Answer: C
Explanation: Only the primary node accepts writes in a replica set; secondaries replicate the primary's oplog asynchronously to maintain data redundancy.
Question 3
Which data format does MongoDB use to store documents internally?
Correct Answer: C
Explanation: BSON (Binary JSON) extends JSON with additional types like Date and ObjectId, enabling efficient storage and traversal.
Question 4
What is the maximum size of a single BSON document in MongoDB?
eqB.match
C.
s a m e D.
sameD.is
Correct Answer: A
Explanation: $eq explicitly matches equality; implicit equality is also supported by specifying field:value directly.
Question 7
What does the $gt operator do in a MongoDB query?
A. Checks greater than or equal
B. Checks greater than
C. Checks global type
D. Checks grouping tag
Correct Answer: B
Explanation: $gt selects documents where the field value is strictly greater than the specified value.
Question 8
Which projection excludes the _id field from results?
A. {_id: 1}
B. {_id: 0}
C. {_id: false, exclude: true}
D. {noId: true}
Correct Answer: B
Explanation: Setting _id: 0 in a projection explicitly excludes the _id field from returned documents.
Question 9
Which index type does MongoDB create automatically on the _id field?
A. Compound index
B. Unique index
C. Text index
D. Geospatial index
Correct Answer: B
t
B
.
projectB.match
C.
g r o u p D.
groupD.sort
Correct Answer: B
Explanation: $match filters documents at the start of an aggregation pipeline, reducing downstream processing.
Question 12
Which aggregation stage reshapes documents by including or excluding fields?
m
a
t
c
h
B
.
matchB.project
C.
g r o u p D.
groupD.unwind
Correct Answer: B
Explanation: $project controls field inclusion, exclusion, and computed fields in the aggregation output.
Question 13
What does the $group stage require to define grouping?
A. A _id expression
B. A sort key
C. A limit value
D. A skip value
Explanation: $sum accumulates numeric values across grouped documents, ignoring non- numeric fields.
Question 15
Which stage deconstructs an array field into multiple documents?
s p l i t B.
splitB.unwind
C.
f l a t t e n D.
flattenD.expand
Correct Answer: B
Explanation: $unwind outputs one document per array element, enabling per-element aggregation or filtering.
Question 16
What is the purpose of the $lookup aggregation stage?
A. Looks up index statistics
B. Performs a left outer join with another collection
C. Searches text indexes
D. Looks up server status
Correct Answer: B
Explanation: $lookup joins documents from another collection in the same database, similar to SQL LEFT JOIN.
Question 17
Which write concern value acknowledges after journaling to disk?
A. w: 0
B. w: 1
C. w: "majority"
D. j: true
Correct Answer: C
Explanation: readPreference: "primary" routes all reads to the primary node, ensuring the most current data.
Question 20
Which MongoDB feature provides automatic failover in a replica set?
A. Sharding
B. Elections
C. GridFS
D. Change streams
Correct Answer: B
Explanation: When the primary becomes unavailable, replica set members hold elections to select a new primary automatically.
Question 21
What is the minimum recommended number of voting members in a replica set?
Correct Answer: C
Explanation: Three voting members allow a majority (2) to elect a primary while tolerating one failure.
Question 22
What role does an arbiter play in a replica set?
A. Stores data copies
B. Votes in elections without storing data
C. Routes queries
D. Manages backups
Correct Answer: B
Explanation: Arbiters participate in elections to break ties but do not store data or serve client requests.
Question 23
Which component stores metadata in a sharded cluster?
A. mongos
B. Config servers
C. Shard nodes
D. Application drivers
Correct Answer: B
Explanation: Ranged sharding assigns contiguous shard key ranges to chunks, supporting range queries efficiently.
Question 26
Which MongoDB method updates a single matching document?
A. updateOne()
B. updateMany()
C. replaceMany()
D. modifyOne()
Correct Answer: A
Explanation: updateOne() modifies the first document matching the filter, leaving other matches unchanged.
Question 27
Which update operator sets a field value?
p
u
t
B
putB.set
C.
a s s i g n D.
assignD.field
Correct Answer: B
Explanation: $set assigns or creates a field with the specified value during an update operation.
Question 28
Which update operator removes a field from a document?
d
e
l
e
t
Explanation: upsert: true inserts a new document if no document matches the update filter.
Question 30
Which option returns the modified document rather than the original in findOneAndUpdate?
A. {returnNew: true}
B. {new: true}
C. {updated: true}
D. {after: true}
Correct Answer: B
Explanation: new: true returns the post-update document; otherwise the pre-update document is returned.
Question 31
Which method deletes a single matching document?
A. deleteOne()
B. removeOne()
C. dropOne()
D. eraseOne()
Correct Answer: A
Explanation: deleteOne() removes the first document matching the filter and returns deletion count.
Question 32
What happens when deleteMany() is called with an empty filter?
A. Deletes nothing
B. Deletes the first document
C. Deletes all documents
D. Throws an error
Correct Answer: C
Explanation: An empty filter {} matches all documents, so deleteMany({}) removes every document in the collection.
Question 33
Which schema design pattern embeds related data in a single document?
A. Normalization
B. Embedding
C. Referencing
D. Sharding
Correct Answer: B