quest

Sign in to start training

quest keeps your progress, streaks, and scores tied to your account — so you can pick up on any device.

Synced everywhere. Progress follows you across laptop and phone.
Streaks & stats. See your daily run and every score over time.
Your profile. A name and avatar for the work you do here.

We only use Google to sign you in and sync progress. No posting, no contacts — ever.

System Design Intermediate

03  Scaling Reads & Writes

One database eventually stops being one database. Replicas multiply your read capacity, shards split your write load -- and each introduces brand-new ways to be wrong that a single box never had.

Step 2 / 2

A chat app's messages table has outgrown one database and must be sharded. Candidate shard keys: message_id, sender user_id, conversation_id. Pick one, justify it with the dominant query, explain why each rejected key fails, and say what you do about one enormously hot conversation.

Hints
  • What is the dominant query in chat? Loading the recent messages of ONE conversation.
  • A good shard key keeps the dominant query on one shard. Which candidate does that?
  • One giant conversation still lands on a single shard. Think secondary splitting -- by time bucket -- or special-casing the whales.
Your design is reviewed against a hidden rubric.