Courseiva

C100DBA · topic practice

Indexing and Performance practice questions

This domain covers MongoDB index selection, compound index field order, index intersection, and the performance cost of over-indexing. Questions present real query patterns and sharded-cluster behavior, asking you to pick the most efficient index or explain why a plan scans more shards or documents than expected.

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: Indexing and Performance

What the exam tests

What to know about Indexing and Performance

You must read explain() output and design compound indexes with equality fields before range fields, matching the query shape. The single most important thing is getting compound index field order right, since it determines whether MongoDB can bound the scan or must examine every candidate document.

Choosing compound index field order for equality-then-range query predicates

Using explain() to read winning plans, IXSCAN, COLLSCAN, and rejected plans

Diagnosing scatter-gather when a query does not target the shard key

Recognizing index write overhead, working set growth, and low-selectivity fields

Watch out for

Common Indexing and Performance exam traps

  • ▸Reversing compound index order so the range field precedes the equality field, forcing a less selective scan.
  • ▸Assuming any shard key filter avoids scatter-gather when the query lacks the full shard key prefix.
  • ▸Adding indexes for every queried field, ignoring write amplification and RAM pressure on the working set.

Practice set

Indexing and Performance questions

20 questions · select your answer, then reveal the explanation

Refer to the exhibit. Why is the query execution plan performing a FETCH stage after an IXSCAN, and how can it be optimized?

Exhibit

db.collection.find({status: 'active', type: 'user'}).sort({created: -1}).explain('executionStats')

'winningPlan': {
  'stage': 'FETCH',
  'inputStage': {
    'stage': 'IXSCAN',
    'keyPattern': { status: 1, type: 1 }
  }
}

Which TWO of the following statements regarding the TTL (Time-To-Live) index are correct?

Which THREE factors significantly impact the performance of a MongoDB write operation?

Refer to the exhibit. A query filters on field 'a'. Which index will the optimizer choose?

Exhibit

db.collection.getIndexes() 
[ { 'v': 2, 'key': { 'a': 1, 'b': 1 } }, { 'v': 2, 'key': { 'a': 1 } } ]

What happens when a $sort operation cannot be satisfied by an index?

A high-throughput collection in a MongoDB cluster experiences degraded write performance due to a heavily fragmented compound index. Which TWO administrative actions safely resolve index fragmentation without downtime? (Choose TWO)

Which TWO statements are true regarding the use of compound indexes in MongoDB?

What is the primary benefit of a 'covered query' in MongoDB?

Which THREE factors contribute to slow query performance in MongoDB?

Refer to the exhibit. Why might this geospatial query be underperforming?

Exhibit

db.collection.createIndex({location: "2dsphere"})
db.collection.find({location: { $near: { $geometry: { type: "Point", coordinates: [...] }, $maxDistance: 1000 } }})

A collection named events contains millions of documents with fields timestamp (Date), userId (String), and eventType (String). A new application query frequently filters on timestamp and userId and sorts by timestamp descending. The DBA creates an index { timestamp: 1, userId: 1 }. The query's performance is still poor because MongoDB must perform an in-memory sort. Which index should the DBA create instead to allow the query to use the index for both filtering and sorting?

A DBA runs db.orders.find({ status: "shipped", customerId: 42 }).explain("executionStats") and sees totalKeysExamined equal to nReturned, but the plan uses an index on { customerId: 1 } rather than the existing { status: 1, customerId: 1 }. The collection has high cardinality on status. Which statement best explains the planner's choice?

A DBA is investigating a slow query on the orders collection. The query is: db.orders.find( { status: "shipped", customerId: 12345 } ).sort( { orderDate: -1 } ). The collection has an index { customerId: 1, status: 1, orderDate: -1 }. The query planner chooses a collection scan instead of using the index. Which action would most likely allow the index to be used effectively?

A collection named orders has a compound index { customerId: 1, orderDate: -1, total: 1 }. A DBA runs a query that filters on customerId and total, and sorts by orderDate descending. Which statement about the query's index usage is correct?

A DBA is optimizing a collection that supports a high volume of read queries. Several queries filter on a field named category and sort by a field named createdAt descending. The DBA wants to create an index that allows these queries to be covered. Which two conditions must be met for a query to be covered by an index? (Choose two.)

A DBA is investigating why a query on a collection with a compound index { a: 1, b: 1, c: 1 } is not using the index for a sort on { b: 1, a: 1 }. The query filters on a and c. Which explanation is correct?

A DBA is designing indexes for a collection that supports a reporting workload. The queries frequently filter on region and status, and sort by createdAt descending. The DBA creates a compound index { region: 1, status: 1, createdAt: -1 }. Which two statements about this index are correct? (Choose two.)

An application frequently queries a large collection using two fields: 'category' (equality) and 'timestamp' (range). Which index strategy provides the most efficient execution plan?

Which property of a field makes it a poor candidate for an index?

When would you choose to create a Partial Index instead of a standard index?

Free account

Track your progress over time

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

Focused Indexing and Performance sessions

Start a Indexing and Performance only practice session

Every question in these sessions is drawn from the Indexing and Performance domain — nothing else.

Related practice questions

Related C100DBA topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the C100DBA exam test about Indexing and Performance?
You must read explain() output and design compound indexes with equality fields before range fields, matching the query shape. The single most important thing is getting compound index field order right, since it determines whether MongoDB can bound the scan or must examine every candidate document.
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 Indexing and Performance questions in a focused session?
Yes — the session launcher on this page draws every question from the Indexing and Performance 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 C100DBA topics?
Use the topic links above to move to related areas, or go back to the C100DBA 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 C100DBA exam covers. They are not copied from any real exam or dump site.