← All questions
Technicalstretch
How would you design the backend for a photo-sharing app's news feed?
How to approach it
Clarify what the feed shows and how fresh it must be, then explain the core choice: build feeds when someone posts, or when someone opens the app.
How a strong answer opens
“I'd like to clarify what the feed shows and how fresh it must be. The core choice is whether to build each person's feed when someone posts or when they open the app.”
Outline of a strong answer
Try answering out loud for a few minutes before you open this.
- Requirements: who appears in the feed, ranking, freshness
- Store photos in object storage behind a CDN; store metadata in a database
- Option A: push posts into followers' feeds when created
- Option B: pull and assemble when a user opens the app
- Hybrid for accounts with huge followings
- Ranking service and caching for speed
- Trade-offs: cost, freshness, load on peak events
Where this question usually goes wrong
Describing one database query per feed load, without discussing precomputed feeds, accounts with huge followings, or caching.
Learn the method
System design for PMs in Module 6, Technical for PMs.
The full kit has worked answers in full, start to finish, for every round type. $129 once.
More technical questions
- How would you design a URL shortener, at the level a PM needs?
- How would you design a notification system that sends millions of push alerts without spamming users?
- Should we build our mobile app natively or with a cross-platform framework?
- How would you handle technical debt on your roadmap?
- Write a SQL query to find the top 10 customers by number of orders last month, and explain how you would check the result.