This was a single question that ate the entire session.
Start by clarifying requirements and scale (e.g., 300M MAU, read-heavy, eventual consistency acceptable). Then walk through the design in layers: data model, core interactions, feed generation, storage, search/trending, and scaling. Emphasize trade-offs and justify choices based on Twitter-like constraints.
Pro tip: Anchor the discussion on the read-heavy nature (100:1 read:write) and how that drives precomputation (fan-out on write) for feeds, while acknowledging the need for a hybrid approach for celebrities. This shows you understand real-world trade-offs.
Ask about expected scale (users, tweets/day), read/write ratio, latency requirements, and consistency needs. Establish assumptions to guide design.
Define entities (User, Tweet, Follow, Like, etc.) and their relationships. Describe core interactions: posting, following, timeline viewing, and engagement.
Explain feed generation (push vs. pull vs. hybrid) and storage choices (SQL vs. NoSQL, caching, blob storage for media). Justify based on access patterns.
Outline how to index tweets for search (e.g., inverted index, Elasticsearch) and compute trending topics (e.g., sliding window, count-min sketch).
Discuss horizontal scaling, sharding, replication, caching, CDN, and async processing. Address bottlenecks and trade-offs.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.