Interview practice question
Query across all shards
System Design · Databases · Intermediate
After sharding by user ID, the product team wants a report of "top 100 users by total spend this month". How do you handle cross-shard queries like this?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Scatter-gather: query each shard, merge results.
- Each shard returns its top 100.
- Expensive for live traffic.
- Better: analytics warehouse via CDC.
- Precompute aggregates.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.