Quick Answer
Scatter-gather queries hit every shard because the query doesn't include the shard key. mongos fans out to all shards, each returns results, mongos merges them. For sorting, all shards sort and return top N results, mongos re-sorts and picks top N. This is expensive and gets worse as shard count grows. Fix: include the shard key in queries to target a single shard (targeted query).
Answer
Scatter-gather queries hit all shards, increasing latency and limiting scalability. Good shard keys minimize this pattern.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
MongoDB interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Perfect for freshers and experienced candidates.