C100DBA Sharding Practice Question
A developer chooses Hashed Sharding for a collection. What is a significant limitation of this sharding strategy compared to Ranged Sharding?
⚠ Common exam trap
Candidates often assume hashed sharding is faster for all queries. They fail to realize that scattering data randomly makes range-based scans inefficient, forcing the cluster to query every shard.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Range-based queries on the shard key will result in broadcast operations.
Hashed sharding ensures an even distribution of data across shards by hashing the shard key values, which is excellent for handling monotonically increasing keys. However, because the hash function essentially randomizes the placement of documents, range-based queries cannot be targeted to a single shard. This choice involves a trade-off between write distribution and query efficiency for specific access patterns.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Hashed sharding does not support compound shard keys.
Why it's wrong here
MongoDB supports hashed sharding on a single field, and as of version 4.4, it also supports compound hashed shard keys. This allows developers to combine a hashed field with one or more ranged fields to achieve both write distribution and some level of query targeting for specific applications.
- ✗
Hashed sharding requires the shard key field to be a numeric type.
Why it's wrong here
The hashing algorithm used by MongoDB can process various data types, including strings and ObjectIDs. There is no requirement that the shard key be a numeric value. The database calculates a 64-bit hash of the field value regardless of its original type to determine the document's chunk.
- ✓
Range-based queries on the shard key will result in broadcast operations.
Why this is correct
In hashed sharding, documents with similar shard key values are unlikely to be stored on the same shard. Consequently, when a query specifies a range of values, the mongos cannot identify a subset of shards and must instead query every shard in the cluster to retrieve the results.
- ✗
Hashed sharding cannot be used with the balancer to move chunks.
Why it's wrong here
The balancer works identically for both hashed and ranged sharding. It monitors the distribution of chunks across shards and performs migrations as needed to maintain balance. The internal representation of ranges in hashed sharding is simply based on the hash values rather than the literal field values.
About these practice questions
One of 222 original C100DBA practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official MongoDB exam blueprint
This C100DBA practice question is part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the C100DBA exam.