What should people be able to do?
“I’ll start with the main things a user needs to do. Which ones should we design today?”
Twitter example
- Post a tweet.
- Follow another user.
- See recent tweets from people they follow.
Technical cues
- Write each requirement as “Users should be able to…”
- Agree on priorities and scope. Leave likes, search, and DMs for later unless asked.
How fast? How big? What can wait?
“How quickly should the feed load? Can it be a few seconds behind if that keeps it available?”
Twitter example
- Aim for feed reads under 200 ms at p95.
- Assume 100 million daily active users and more reads than writes.
- Keep the feed available even if new tweets take a few seconds to appear.
Technical cues
- Pick 3–5 qualities that shape the design. Give them targets where you can.
- Check whether durability, security, fault tolerance, or compliance changes a decision.
Would a number change my choice?
“If we keep a short feed for every active user, how much memory would that take?”
Twitter example
100M users × 200 tweet IDs × 8 B = 160 GB of raw IDs if all those feeds are cached at once.
Technical cues
- Do the math when you reach the decision. Here it helps size and shard the cache.
- Allow for cache overhead and replicas. Revisit how many feeds actually need to stay warm.
What are the main things?
“There’s a person, a post, and a record of who follows whom.”
Twitter example
- User writes tweets and follows people.
- Tweet belongs to an author.
- Follow links a follower to the account they follow.
Technical cues
- Name the entities and relationships now. Add columns and indexes when you draw storage.
- The home feed is a view of tweets. It can be computed or cached.
What does the app ask for?
“I’ll give each of our three user actions a request the app can make.”
Twitter example
POST /tweetstakes text and returns a tweet ID.POST /followstakes the account to follow.GET /feeds?cursor=…returns tweets and a cursor for the next page.
Technical cues
- Start with REST. Use the signed-in user for the author, follower, and feed owner.
- If live updates enter scope, consider SSE for server push or WebSockets for two-way messages.
What happens first, then what?
“If work happens in the background, I’ll write down the steps in order.”
Twitter example
- Save the tweet.
- Publish an event that a tweet was created.
- A worker can add its ID to followers’ cached feeds.
Technical cues
- For simple request and response paths, fold this into the diagram on the next page.
- For a pipeline, mark where the request ends and where background work begins.
Draw one working path at a time.
“I’ll draw what happens when someone posts, then follow the path for a follow and a feed read.”
Twitter example
- Post → API gateway → tweet service → tweets table.
- Follow → API gateway → follow service → follows table.
- Read → feed service → followed IDs → recent tweets → merge, sort, return.
Technical cues
- Store tweet ID, author ID, text, and creation time. Index tweets by author and time.
- Check each endpoint has a path. Mark where feed reads get expensive and check in with the interviewer.
Where does it slow down or break?
“Reading the feed means checking lots of accounts. What if we do some of that work when someone posts?”
Twitter example
- On write Push tweet IDs to followers’ Redis feed lists. Reads get faster and each post creates more work.
- On read For accounts with millions of followers, pull recent tweets when a feed opens and merge them with cached entries.
Technical cues
- Watch p95 feed latency and queue age. Queue lag shows up as stale feeds.
- Retry worker jobs and deduplicate by feed and tweet ID. If the cache fails, cap any slower fallback to protect storage.
Follow the interviewer’s lead. Mark any path you skipped so you can come back to it.
Pick one problem to solve.
“Who needs what? Where does it live? How does it move? What breaks first?”
- Everyone asks for the same thing.
- Cache common reads.
- Work arrives faster than we finish it.
- Bound the queue. Slow or reject new work.
- One machine can’t hold it all.
- Shard across machines.
- A machine dies.
- Replicate, then fail over.
- The same request comes in twice.
- Use an idempotency key or deduplicate.
- A worker stops halfway.
- Resume from a checkpoint or replay a durable queue.
- Two people edit the same thing.
- Check the version before accepting the write.
- Users need to see progress.
- Return a job ID. Poll or push updates with SSE.
The time budgets are flexible. In a 55-minute interview, use spare time for follow-ups and a recap.