Try
↑ ↓ move↵ openesc close

Interview prep / News feed

Senior · News feed · System design interview question

How would you choose the celebrity threshold, and what happens when an account crosses it?

Sketch your own answer first, then compare it with the one below.

A strong answer

Start from two budgets. The write side: how many inserts one post may cost before it delays others. The read side: how many extra pulls a read can afford. The threshold is where those meet. Lowering it makes writes cheaper and reads slower.

Activity can matter too. A very active account with moderate followers can be pulled, and a quiet one with many followers can be pushed.

When an account crosses, switch it to pull for new posts and leave old copies. Filter at read time for deletes and unfollows.

Sources

Learn it by running it

The design a news feed lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms