Start by clarifying requirements and scale, then design a high-level architecture that separates feed generation (write path) from feed retrieval (read path). Focus on trade-offs between push and pull models, and discuss how to handle fan-out, ranking, and storage for scalability.
Pro tip: Emphasize the importance of defining SLAs and prioritizing freshness vs. completeness based on product needs; this shows you understand real-world constraints beyond just technical components.
Ask about scale (users, posts per day), read/write ratio, latency requirements, and feed ranking criteria (chronological vs. algorithmic).
Outline core components: post service, fan-out service, feed cache, and feed retrieval service. Decide on push vs. pull vs. hybrid model.
Explain how posts are fanned out to followers, including handling of celebrities (hybrid approach) and use of message queues for asynchronous processing.
Discuss data stores for posts (e.g., MySQL, Cassandra) and feeds (e.g., Redis, in-memory), and how to efficiently retrieve and rank feed items.
Address scaling reads/writes, caching strategies, consistency vs. availability, and trade-offs between push and pull models.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.