← Twitter Interview Insights

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

SeniorPrefer not to say
Apr 2026

Summary

Twitter system design round, one question about designing their API. Not much to go on but it's a meaty enough topic that it kept me busy for the whole session.

Questions Asked (1)

Q1

Design Twitter's API.

API & IntegrationsSystem DesignTechnical Trade-offs
Author's notes

Started with the core resources: users, tweets, timelines, follows.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scope and core requirements of Twitter's API, such as read/write operations, rate limits, and real-time updates. Then outline a high-level design covering key endpoints, data models, and scalability considerations, and dive into one or two areas in depth based on interviewer interest.

Pro tip: Demonstrate awareness of Twitter's unique challenges like the firehose and fan-out on write, and discuss trade-offs between consistency and availability for different endpoints.

1. Clarify Requirements and Scope

Ask questions to understand which parts of Twitter's API to focus on (e.g., tweets, timelines, search, streaming) and non-functional requirements like latency, throughput, and consistency.

2. Define Core Resources and Endpoints

Identify main entities (users, tweets, follows) and design RESTful endpoints for key operations (post tweet, get timeline, follow user) with appropriate HTTP methods and status codes.

3. Design Data Models and Storage

Propose schemas for users, tweets, and relationships, and choose storage solutions (e.g., SQL for user data, NoSQL for tweets, graph DB for social graph) based on access patterns.

4. Address Scalability and Performance

Discuss partitioning, caching, and asynchronous processing (e.g., fan-out on write for timelines) to handle high read/write volumes and ensure low latency.

5. Discuss Trade-offs and Extensions

Highlight trade-offs (e.g., consistency vs. availability, push vs. pull for timelines) and mention extensions like rate limiting, authentication, and real-time streaming.

Key Points to Mention

  • RESTful API design with proper resource naming and HTTP methods
  • Rate limiting and authentication (OAuth) to protect the API
  • Data partitioning and replication for scalability
  • Caching strategies (e.g., Redis) for hot data like timelines
  • Fan-out on write vs. fan-out on read for timeline generation
  • Real-time streaming API for firehose and filtered streams

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