Courseiva
Sharding →hardMultiple Choice

C100DBA Sharding Practice Question

When is it appropriate to use a hashed shard key instead of a ranged shard key in a MongoDB sharded collection?

⚠ Common exam trap

Candidates often choose ranged shard keys for monotonically increasing fields, creating severe write bottlenecks on a single 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

✓

When the application generates monotonically increasing write keys, and the primary objective is to distribute write operations evenly across all shards to prevent bottlenecks.

Hashed shard keys are ideal when incoming write operations rely on monotonic or sequential values, such as auto-incrementing IDs or timestamps. Hashing prevents write bottlenecks by scattering insertions across all cluster shards, whereas ranged keys would force all writes onto a single shard.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    When the application generates monotonically increasing write keys, and the primary objective is to distribute write operations evenly across all shards to prevent bottlenecks.

    Why this is correct

    When the application generates monotonically increasing write keys, and the primary objective is to distribute write operations evenly across all shards to prevent bottlenecks. Hashing sequential inputs randomizes their distribution, ensuring all shards share the write workload instead of overloading the maximum chunk.

  • ✗

    When the application executes frequent range-based find queries that require contiguous document retrieval across multiple chunks.

    Why it's wrong here

    When the application executes frequent range-based find queries that require contiguous document retrieval across multiple chunks. Hashed keys destroy range locality, forcing range queries to execute as inefficient scatter-gather operations across every shard in the cluster.

  • ✗

    When the collection dataset size is guaranteed to remain under one gigabyte, eliminating the need for automated chunk balancing.

    Why it's wrong here

    When the collection dataset size is guaranteed to remain under one gigabyte, eliminating the need for automated chunk balancing. Sharding small collections is generally discouraged, and dataset size limits do not dictate the choice between ranged and hashed sharding strategies.

  • ✗

    When compliance regulations require all database documents to be encrypted using deterministic hashing algorithms at rest.

    Why it's wrong here

    When compliance regulations require all database documents to be encrypted using deterministic hashing algorithms at rest. Shard key hashing is purely a data routing and distribution mechanism and does not provide data encryption or compliance security features.

About these practice questions

Courseiva writes every C100DBA question from scratch — 222 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.