Skip to content

← Interview Arena

Design a social feed

Design a social feed

The Arena needs JavaScript to run an interview.

Design the home feed of a social network. People follow accounts, publish short posts, and open a feed of the newest posts of the accounts they follow. Work through the stages in order, as you would on a whiteboard: requirements, numbers, architecture, scaling, consistency, reliability, failure and trade-offs.

Key facts

Daily active users
20 million
Feed opens
10 per user per day
New posts
2 million a day
Followers
Most accounts have about 200 followers. About 1 post in 1,000 comes from an account with 1 million followers.
Peak
Assume the busiest moment is 3 times the average
Timeline and post size
A user's timeline keeps the newest 500 post identifiers, 8 bytes each. A post is about 1 KB.

Constraints

  • Ranking by relevance, media, replies, likes, search and notifications are out of scope: the feed is the newest posts first.
  • The service runs in one region.
  • The figures are illustrative targets for this exercise, not measurements of a real service.

Suggested time per stage

  1. Requirements05:00
  2. Estimation06:00
  3. Architecture10:00
  4. Scaling06:00
  5. Consistency04:00
  6. Reliability04:00
  7. Failure scenarios05:00
  8. Trade-offs05:00
Mode

You can pause the clock, nothing is locked, and running out of time is only shown.

The clock cannot be paused. At zero, the stage you are on is locked as written and the stages after it score zero.

Length

Built by GhaziAlibi.

© ShardCraft. All rights reserved.