Difficulty: 6/10shard key selection, chunk distribution, balancer behaviorA shard is a horizontal partition of data in a database. It is essentially a subset of your data stored across multiple servers.Scenario Questions0-2 years experience1We need to store rapidly growing user profiles. How would you enable sharding for this collection, and which field would you pick as the shard key?2If you insert a document whose shard key value falls outside any existing chunk range, what does MongoDB do?3When a query filters only on a non‑shard‑key field, how does MongoDB route that query in a sharded cluster?2-5 years experience1After adding a new shard, some reads became slower. Walk me through how you’d diagnose the issue and which sharding components you’d examine.2Our app started throwing 'StaleShardVersion' errors after a recent chunk migration. Explain why this occurs and how you’d fix it.3Given a compound shard key {region, userId}, what trade‑offs does this key introduce for typical read and write patterns?5-8 years experience1Design a sharding strategy for a multi‑tenant SaaS platform that stores both transactional and analytical data, addressing data isolation, hot‑spot avoidance, and rebalancing impact.2A particular shard is becoming a hotspot because the shard key distribution is skewed. What mitigation techniques would you apply at the system level?3Compare using a hashed shard key versus a ranged shard key in terms of query performance, balancing, and when you’d choose each.8+ years experience1We’re migrating a legacy monolithic MongoDB deployment to a globally distributed sharded architecture across three data centers. Outline the architectural considerations, migration steps, and operational safeguards you’d put in place to ensure continuity and low latency.2How would you establish a cross‑team governance model for shard‑key selection and chunk‑migration policies to prevent future performance regressions in a large organization?Follow-up QuestionsCan you describe what happens during a chunk migration?Why is choosing the right shard key so critical?How does the balancer decide when to move chunks?Suggest Improvement