Problem
Design a backend system for a gaming app that supports:
-
Favorites ("Fav")
: users can favorite/unfavorite games and view their favorites list.
-
Social recommendations
: show recommended games such as
"Your friends played this game"
/
"Popular among your friends"
.
Assume the product has tens of millions of users and a large game catalog.
Requirements
Functional
-
Favorite/unfavorite a game.
-
List a user’s favorited games (paginated, sorted by most recent).
-
Generate a
social recommendation feed
for a user based on friends’ activity:
-
Friends who played a game recently
-
Friends who favorited/liked a game
-
Optional: trending in your friend network
Non-functional
-
Low latency for reads (favorites list and recommendations).
-
Correctness guarantees for favorites (no duplicates; idempotent operations).
-
Handle privacy settings (e.g., user hides activity; blocked users).
-
Scalable ingestion of play/favorite events.
-
Reasonable freshness (e.g., within minutes) for recommendations.
Output
Describe APIs, data/storage design, event pipeline, recommendation logic/ranking, caching, and how you would scale and measure quality.