← Meta Interview Insights

Meta·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
May 2026

Summary

Meta EM interview with a system design question focused on building live commenting for Facebook. Pretty open-ended, which I wasn't fully prepared for.

Questions Asked (1)

Q1

How would you design a live commenting system for Facebook?

System DesignTechnical Trade-offsData Modeling
Author's notes

I started with the data model and fan-out logic but quickly realized I was treating it like a static feed problem.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale (e.g., billions of users, millions of concurrent comments per post), then outline a high-level architecture covering real-time delivery, storage, and ranking. Dive into key components like WebSocket connections, pub/sub, and data modeling, discussing trade-offs and optimizations.

Pro tip: Emphasize the importance of handling hot posts (e.g., celebrity posts with millions of comments) through techniques like sharding, caching, and rate limiting, and discuss how to ensure low-latency delivery while maintaining consistency.

1. Clarify Requirements and Scale

Ask questions to understand functional and non-functional requirements: expected QPS, latency targets, consistency needs, and features like threading, reactions, and moderation. Estimate scale (e.g., 2B users, 100M concurrent comments).

2. High-Level Architecture

Sketch the main components: clients (web/mobile), API gateway, comment service, real-time delivery service (WebSocket/SSE), storage (SQL/NoSQL), cache, and message queue/pub-sub. Explain data flow from comment creation to delivery.

3. Data Modeling and Storage

Design the data model for comments (e.g., comment ID, post ID, user ID, content, timestamp, parent ID for threading). Choose storage: a distributed SQL (like MySQL) for consistency or NoSQL (like Cassandra) for scalability, and discuss indexing for efficient retrieval.

4. Real-Time Delivery and Scalability

Detail how to push comments to clients in real-time using WebSockets and a pub/sub system (e.g., Kafka, Redis Pub/Sub). Discuss scaling connections with load balancers and handling fan-out to millions of subscribers.

5. Trade-offs and Optimizations

Discuss trade-offs: consistency vs. availability, latency vs. cost, and push vs. pull. Optimize with caching (e.g., Redis for hot comments), sharding by post ID, rate limiting, and moderation pipelines.

Key Points to Mention

  • WebSocket for persistent connections and real-time updates
  • Pub/sub system (e.g., Kafka) for decoupling and fan-out
  • Data model with parent-child relationships for threaded comments
  • Sharding and caching strategies for hot posts
  • Consistency models (e.g., eventual consistency for comments)
  • Rate limiting and moderation to prevent spam and abuse

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.