Code Room
System designHard
Question
Design the sharding scheme for the message store of a large team-chat product: ~2B messages/day, 100M channels, reads are channel-scoped (load last N messages, paginate backward), and a small number of channels (a few thousand 'mega' channels) get 1000x the traffic of the median. Hot channels can spike 50x within minutes during live events. You must support online resharding without downtime and keep p99 channel-history reads under 80ms. Describe the partition key, the topology, how you handle hot channels, and how resharding works.
What a strong answer looks like
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.
Learn the concepts
Loading whiteboard…
Run or narrate your approach, then ask the coach.