Courseiva

C100DEV · topic practice

Aggregation Framework practice questions

The Aggregation Framework domain covers building multi-stage pipelines that transform, filter, group, and combine documents in MongoDB. Questions present realistic scenarios—session analytics, indexed filtering, cross-collection merging—and ask you to choose the correct stage, operator, or ordering. Expect a mix of operator identification and pipeline-design reasoning rather than syntax memorization.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Editorial oversight:Johnson Ajibi· MSc IT Security, IEEE Senior Member
20 questionsDomain: Aggregation Framework

What the exam tests

What to know about Aggregation Framework

Build a correct pipeline: filter early with $match on indexed fields, group with the right accumulator like $avg, and use $unionWith to append another collection's results. The single most important thing is stage order—$match and $sort belong before $group to stay efficient.

Selecting stages like $match, $group, $sort, $project, and $unionWith for a given transformation goal

Using accumulators such as $avg, $sum, $min, and $max inside a $group stage

Ordering pipeline stages so $match and $sort leverage indexes before expensive operations

Combining collections with $unionWith and shaping output with $project and $addFields

Why learners struggle

Why Aggregation Framework questions are commonly missed

RAM questions are commonly missed because learners confuse physical form factors (DIMM vs SO-DIMM) and fail to distinguish between memory speed (MHz) and latency (CL).

  • ·DIMM vs SO-DIMM — desktop vs laptop form factor confusion
  • ·DDR3 vs DDR4 vs DDR5 — notch position and voltage differences
  • ·MHz vs CL — speed vs latency trade-offs in performance
  • ·Single-channel vs dual-channel — bandwidth impact misconception
  • ·ECC vs non-ECC — error correction support in servers vs desktops
  • ·32-bit vs 64-bit — maximum addressable RAM limit

Watch out for

Common Aggregation Framework exam traps

  • ▸Placing $match after $group, which forces processing of unfiltered documents and prevents early index use.
  • ▸Confusing $avg with $sum or applying accumulators outside a $group stage where they are invalid.
  • ▸Assuming $unionWith deduplicates or joins on a key; it appends result sets and does not match documents.

Practice set

Aggregation Framework questions

20 questions · select your answer, then reveal the explanation

Which THREE of the following are valid ways to limit the memory usage of an aggregation pipeline?

Which TWO of the following are true regarding the $match stage?

You are aggregating a collection of orders. You need to calculate the total revenue per product, but only for orders placed in 2023. Which pipeline sequence is most efficient?

Which TWO of the following statements regarding the $lookup stage are accurate?

Refer to the exhibit. Which index would most effectively optimize this aggregation query?

Exhibit

db.sales.aggregate([
  { $group: { _id: "$category", total: { $sum: "$amount" } } },
  { $sort: { total: -1 } }
])

Which THREE of the following are valid ways to handle missing or null fields in an aggregation pipeline?

What is the primary difference between $project and $set stages in an aggregation pipeline?

Which approach is recommended to aggregate data across a sharded collection effectively?

Which THREE of the following are true regarding the $facet stage?

What happens if you omit the '_id' field in a $group stage?

You need to compute the average rating of products across an e-commerce catalog, but only include products that have received at least 5 reviews. Which aggregation pipeline stage sequence correctly accomplishes this filtering condition efficiently?

A pipeline processes a collection of employees. The developer wants to add a new field named annualBonus that equals the employee's salary multiplied by 0.1, without removing any existing fields. Which stage accomplishes this?

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?

A retail company stores orders in a collection where each document has a 'customerId' field, an 'items' array, and a 'status' field. A developer needs to produce a report that shows, for each customer, only the total number of items across all their orders that have status 'completed'. The 'items' array contains subdocuments with a 'qty' field. Which aggregation pipeline snippet correctly computes this?

An aggregation pipeline processes a collection of log entries. The developer needs to filter documents where the status field is "error" and then count the number of errors per service. Which sequence of stages correctly achieves this?

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?

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?

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.)

A retail company stores sales in a collection named sales with documents containing fields: storeId (string), amount (double), and saleDate (date). A developer needs to produce a report that shows, for each store, the total sales amount and the number of transactions, but only for transactions with amount greater than 100. Which aggregation pipeline correctly computes this?

A collection `employees` contains documents with fields `name`, `department`, and `skills` where `skills` is an array of strings. You need to produce a document for each employee that contains only `name` and the number of skills, with the count field named `skillCount`. Which aggregation stage and expression should you use?

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Aggregation Framework sessions

Start a Aggregation Framework only practice session

Every question in these sessions is drawn from the Aggregation Framework domain — nothing else.

Related practice questions

Related C100DEV topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the C100DEV exam test about Aggregation Framework?
Build a correct pipeline: filter early with $match on indexed fields, group with the right accumulator like $avg, and use $unionWith to append another collection's results. The single most important thing is stage order—$match and $sort belong before $group to stay efficient.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Aggregation Framework questions in a focused session?
Yes — the session launcher on this page draws every question from the Aggregation Framework domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other C100DEV topics?
Use the topic links above to move to related areas, or go back to the C100DEV question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the C100DEV exam covers. They are not copied from any real exam or dump site.
MongoDB Certified Associate Developer Aggregation Framework Practice Questions with Explanations | Courseiva