Courseiva
← Back to MongoDB Certified Associate Developer questions

Scenario-based practice

Hard Difficulty Questions

Practise MongoDB Certified Associate Developer practice questions — original exam-style scenarios covering every exam domain, with detailed explanations, wrong-answer analysis, and common exam traps.

20
scenario questions
C100DEV
exam code
MongoDB
vendor

Scenario guide

How to approach hard difficulty questions

These are the questions most candidates get wrong. They require connecting multiple concepts, reading tricky output, or knowing edge-case behaviour that isn't on most study cards. Practising them trains you to operate under uncertainty — a necessary skill on the real exam.

Quick answer

Hard Difficulty Questions questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider exam objective.

Related practice questions

Related C100DEV topic practice pages

Scenario questions usually connect to one or more exam topics. Use these links to review the underlying concepts behind the scenario.

Practice set

Practice scenarios

Question 1hardmultiple choice
Full question →

You have a collection with 10 million documents. Most documents have a 'status' of 'processed', but about 1% have a 'status' of 'pending'. You frequently query for 'pending' documents sorted by 'creation_date'. Which indexing strategy provides the best balance between write performance and query efficiency?

Question 2hardmulti select
Full question →

Which TWO of the following statements regarding wildcard indexes in MongoDB are correct?

Question 3hardmulti select
Full question →

Which THREE factors influence the latency of a MongoDB transaction?

Question 4hardmultiple choice
Full question →

Refer to the exhibit. You have a document structure where orders are embedded in the user profile. As the number of orders grows, you notice performance issues during document updates. What is the most effective way to resolve this while maintaining read performance?

Exhibit

{"user_id": 101, "orders": [{"id": 1, "total": 50}, {"id": 2, "total": 100}]}
Question 5hardmultiple choice
Full question →

What is the primary consequence of having too many indexes on a collection that experiences a high volume of write operations?

Question 6hardmultiple choice
Full question →

Refer to the exhibit. You have a collection where each document contains a 'tags' array. If you frequently query for documents containing specific tags, what is the best way to model and index this data?

Exhibit

db.collection.createIndex({ "tags": 1 })
Question 7hardmultiple choice
Full question →

Refer to the exhibit. The document uses the Attribute Pattern. Why is this model superior for indexing compared to storing specs as a single sub-document `{ RAM: '16GB', CPU: 'i7' }`?

Exhibit

{
  "product": "laptop",
  "specs": [
    { "k": "RAM", "v": "16GB" },
    { "k": "CPU", "v": "i7" }
  ]
}
Question 8hardmultiple choice
Full question →

A developer is building a MongoDB application to store blog posts and their comments. Comments are frequently added and retrieved alongside the post, but the total number of comments per post can grow to thousands. The developer wants to optimize for read performance of the post with its comments while keeping document size manageable. Which data modeling approach is most appropriate?

Question 9hardmultiple choice
Full question →

A developer is designing a MongoDB collection to store orders. Each order document contains an array of line items, and each line item has a product ID and quantity. The developer needs to frequently query for orders that contain a specific product ID with a quantity greater than 5. Which field should be indexed to optimize this query?

Question 10hardmultiple choice
Full question →

An application stores customer profiles in a MongoDB collection. A developer notices that documents created by different services have inconsistent shapes: some use a string for phone, others an array of strings, and some omit the field entirely. The team wants to enforce a consistent structure for new writes while still allowing existing documents to remain. Which MongoDB feature should they use?

Question 11hardmultiple choice
Full question →

A developer is using the MongoDB Node.js driver to execute a multi-document transaction. The transaction updates a document in the 'orders' collection and inserts a record into the 'audit' collection. After committing, the developer wants to ensure that the transaction is retried automatically if it encounters a transient error. Which driver feature should be used?

Question 12hardmultiple choice
Full question →

A financial application stores transaction records in a MongoDB collection. Each transaction document includes a Decimal128 amount field and a Date field for the transaction time. A developer needs to query for transactions with amounts greater than 100.00 and times within the last 24 hours, and wants the queries to use indexes efficiently. Which statement about the document model and BSON types is correct for this scenario?

Question 13hardmulti select
Full question →

A developer is using the MongoDB Node.js driver to manage sessions for a multi-document transaction. Which TWO actions are required to ensure that the session is properly ended and resources are released? (Choose two.)

Question 14hardmulti select
Full question →

A developer is using the MongoDB Node.js driver to implement a multi-document transaction that transfers funds between two accounts in a banking application. The transaction must be resilient to transient errors and ensure that both the debit and credit operations are applied atomically. Which two of the following statements are true regarding transaction error handling and retry logic in this scenario? (Choose two.)

Question 15hardmultiple choice
Full question →

A developer is using the $lookup stage to join an orders collection with a customers collection. The localField is customerId and the foreignField is _id. The pipeline must include only the customer's name and email from the joined documents, not the entire customer document. Which approach correctly shapes the joined data?

Question 16hardmulti select
Read the full wireless explanation →

A developer is using MongoDB Atlas Search to implement a search feature for an e-commerce application. They have created an Atlas Search index on the 'products' collection with a custom analyzer. They now need to write an aggregation pipeline stage to perform a search that returns products matching a query for 'wireless headphones' and also includes a count of the total number of matching documents. Which two aggregation stages should they use in their pipeline? (Choose two.)

Question 17hardmultiple choice
Full question →

You are building a pipeline over an `events` collection to compute, per `deviceId`, the count of events and the most recent `eventTime`. Documents may contain a `deviceId` of type string, but a subset of legacy documents store the identifier as an ObjectId in the same field. You want a single group key that treats both representations consistently by producing a string for every document. Which stage should you insert before $group?

Question 18hardmultiple choice
Full question →

A pipeline processes a collection of financial transactions. The developer needs to calculate the cumulative sum of `amount` for each account, ordered by `date`, and output only the final cumulative sum and account ID. Which pipeline correctly computes the running total?

Question 19hardmulti select
Full question →

A developer is building an aggregation pipeline that processes a large collection of financial transactions. The pipeline includes a $group stage that accumulates sums and averages, and a $sort stage that orders results by total amount. Which two statements about memory usage and optimization are correct? (Choose two.)

Question 20hardmultiple choice
Full question →

A developer has a collection named orders with documents containing a field items that is an array of subdocuments, each with productId and quantity. The developer needs to find the total quantity sold for each product across all orders. Which aggregation pipeline achieves this?

These C100DEV practice questions are part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style C100DEV questions with detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics.