← DoorDash Interview Insights

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

SeniorPrefer not to say
Jun 2026

Summary

System design round at DoorDash where they asked me to design a Twitter-scale service. Pretty classic question but the scope was wide enough that I kept second-guessing where to spend my time.

Questions Asked (4)

Q1

Design a Twitter-like service covering core features: posting tweets, following/unfollowing users, home timeline, profile timeline, likes, retweets, and replies.

System DesignTechnical Trade-offsData Modeling
Author's notes

The scope of this thing is massive and I burned too much time on the tweet storage schema before they nudged me toward timelines.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then design the data model and APIs, followed by the high-level architecture. Focus on the core features and discuss trade-offs, especially for the home timeline generation (fan-out on write vs. read).

Pro tip: Demonstrate awareness of the read-heavy nature of social feeds and propose a hybrid approach for timeline generation, leveraging caching and precomputation for active users while handling celebrities differently.

1. Requirements and Scale

Clarify functional and non-functional requirements, including expected scale (users, tweets, reads/writes per second) and latency goals.

2. Data Model and APIs

Define the core entities (User, Tweet, Follow, Like, Retweet, Reply) and their relationships, and sketch the key API endpoints for each feature.

3. High-Level Architecture

Outline the main components: load balancers, application servers, databases (SQL/NoSQL), caches, and message queues. Explain how they interact.

4. Timeline Generation Strategy

Discuss approaches for home and profile timelines: fan-out on write vs. fan-out on read, and how to handle celebrities and inactive users.

5. Trade-offs and Optimizations

Analyze trade-offs (consistency vs. availability, latency vs. cost) and propose optimizations like caching, sharding, and denormalization.

Key Points to Mention

  • Fan-out on write vs. fan-out on read for timeline generation, and hybrid approach for scalability.
  • Data storage choices: SQL vs. NoSQL for different entities, and sharding strategies (e.g., by user ID).
  • Caching strategies for hot data (e.g., timelines, user profiles) using Redis or Memcached.
  • Handling celebrities with many followers: push vs. pull, and possible use of a separate service.
  • Consistency models: eventual consistency for timelines, strong consistency for user actions like follow/unfollow.
  • API design: RESTful endpoints, pagination, and rate limiting.

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

Q2

How would you handle timeline reads at low latency for hundreds of millions of users, given that the system is heavily read-dominant?

System DesignTechnical Trade-offs
Author's notes

Went straight to caching.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what is the timeline (e.g., user feed, order history), expected read QPS, latency SLA, and consistency needs. Then propose a multi-layered caching strategy with aggressive CDN/edge caching, a distributed cache like Redis, and a read-optimized datastore, while discussing trade-offs around consistency, cost, and complexity.

Pro tip: Emphasize that at this scale, caching is not just an optimization but a fundamental architectural component; mention that you would design for cache invalidation and stampede protection from day one, as these are common pitfalls.

1. Clarify Requirements and Constraints

Ask about the timeline's data size, read/write ratio, latency target (e.g., p99 < 100ms), consistency requirements (strong vs eventual), and budget. This ensures the solution aligns with business needs.

2. Design a Multi-Tier Caching Strategy

Propose caching at multiple levels: CDN for static/immutable content, edge caching for personalized but cacheable data, and a distributed in-memory cache (e.g., Redis) for dynamic timelines. Discuss cache eviction policies and TTLs.

3. Choose a Read-Optimized Data Store

Select a database that scales reads horizontally, such as a NoSQL store (e.g., Cassandra, DynamoDB) or a read replica setup with a relational DB. Consider denormalization and precomputed timelines for fast access.

4. Address Consistency and Invalidation

Explain how to handle cache invalidation (e.g., write-through, write-behind, or event-driven invalidation) and trade-offs between consistency and latency. Mention techniques like versioning or time-based invalidation.

5. Discuss Scalability and Resilience

Cover horizontal scaling of cache and database layers, sharding, replication, and handling cache failures (e.g., circuit breakers, fallbacks). Also mention monitoring and load testing.

Key Points to Mention

  • CDN and edge caching for static or semi-static timeline content
  • Distributed caching with Redis or Memcached, including sharding and replication
  • Read replicas and denormalization for database scalability
  • Cache invalidation strategies (TTL, write-through, event-driven)
  • Cache stampede prevention (e.g., mutex locks, probabilistic early expiration)
  • Trade-offs between consistency, latency, cost, and complexity

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

Q3

How would you store and query the social graph (who follows whom) to support follow/unfollow operations and timeline generation?

System DesignData Modeling
Author's notes

Said adjacency list in a relational table with indexes on both follower and followee columns.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (scale, read/write ratio, latency, consistency) and then propose a hybrid storage model: a graph store for relationships and a denormalized timeline cache for fast reads. Explain how follow/unfollow operations update both stores asynchronously, and how timeline generation uses fan-out on write or read based on user activity.

Pro tip: Emphasize the trade-off between fan-out on write (push) and fan-out on read (pull), and suggest a hybrid approach for celebrity users to avoid write amplification. Also mention using a graph database like Neo4j for relationship queries and a wide-column store like Cassandra for timeline storage to handle scale.

1. Clarify Requirements and Scale

Ask about the number of users, average follows per user, read/write ratio, and latency requirements. This determines whether to optimize for reads or writes.

2. Design the Social Graph Storage

Propose a graph representation (e.g., adjacency lists) stored in a scalable database. Discuss using a graph DB (Neo4j) or a relational DB with proper indexing, and how to handle follow/unfollow operations efficiently.

3. Design Timeline Generation Strategy

Explain fan-out on write (precompute timelines) vs fan-out on read (compute on demand). Discuss hybrid approach for celebrities and how to store timelines (e.g., Redis, Cassandra).

4. Handle Follow/Unfollow Operations

Describe how a follow/unfollow updates the graph and triggers timeline updates. Discuss consistency (eventual vs strong) and idempotency.

5. Address Scalability and Trade-offs

Discuss sharding, caching, and handling hot users. Mention monitoring and potential bottlenecks.

Key Points to Mention

  • Graph storage options: adjacency list in SQL vs NoSQL vs graph database
  • Fan-out on write vs fan-out on read and hybrid approach for celebrities
  • Denormalization and caching for fast timeline reads
  • Handling follow/unfollow with idempotent operations and eventual consistency
  • Sharding strategies for social graph and timelines
  • Trade-offs between consistency, latency, and cost

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

Q4

How would you approach search and trending topics in this system?

System DesignTechnical Trade-offs
Author's notes

Ran out of steam here near the end.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and scope of search and trending topics in the context of DoorDash's platform, then outline a high-level architecture that addresses both. Discuss trade-offs between different technologies and approaches, emphasizing scalability, latency, and relevance.

Pro tip: Demonstrate awareness of DoorDash's specific use cases, such as searching for restaurants, dishes, or groceries, and trending topics like popular cuisines or local favorites. Highlight how you would leverage existing infrastructure and data to provide personalized results.

1. Clarify Requirements

Ask questions to understand the scope: What entities are searchable (restaurants, dishes, stores)? What are the key metrics (latency, relevance, scale)? How are trending topics defined and updated?

2. High-Level Architecture

Propose a system that includes data ingestion, indexing, query processing, and ranking. For trending topics, include a real-time analytics component to compute trends.

3. Search Implementation

Discuss using a search engine like Elasticsearch for full-text search, with inverted indexes. Cover query understanding, ranking (e.g., learning-to-rank), and personalization.

4. Trending Topics Implementation

Explain how to compute trends using stream processing (e.g., Kafka, Flink) and windowed aggregations. Store results in a low-latency store like Redis for quick retrieval.

5. Trade-offs and Scalability

Discuss trade-offs: consistency vs. latency, batch vs. stream processing, and cost. Address scaling with sharding, replication, and caching.

Key Points to Mention

  • Use of inverted indexes and search engines (e.g., Elasticsearch) for efficient text search.
  • Real-time stream processing for trending topics (e.g., Kafka, Flink) with windowing.
  • Caching strategies (e.g., Redis) to reduce latency for popular queries and trends.
  • Ranking and personalization using machine learning models.
  • Scalability considerations: sharding, replication, and load balancing.
  • Trade-offs between consistency, availability, and latency (CAP theorem).

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