← DoorDash Interview InsightsSoftware Engineer

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

SeniorPrefer not to say
Jun 2026

Summary

System design round at DoorDash, got asked to build a Twitter-like service from scratch. Pretty broad scope and they wanted real depth on the tradeoffs, not just a surface-level walkthrough.

Questions Asked (3)

Q1

Design a Twitter-like service covering core features like posting tweets, following users, home and profile timelines, and interactions like likes, retweets, and replies.

System DesignTechnical Trade-offsData Modeling
Author's notes

I started with the functional requirements which felt right, but I spent too long on the basic tweet storage part before getting to the interesting stuff.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale (e.g., 500M users, 10K tweets/sec), then design the data model and APIs for core entities (users, tweets, follows, likes). Focus on the home timeline generation strategy (fan-out on write vs. read vs. hybrid) and discuss trade-offs, caching, and storage choices for high availability and low latency.

Pro tip: Explicitly call out the celebrity problem and propose a hybrid fan-out approach: push tweets to followers for normal users, but pull tweets from celebrities at read time. This shows you understand real-world scaling challenges beyond textbook solutions.

1. Clarify Requirements and Scale

Ask about functional requirements (post, follow, timeline, likes, retweets, replies) and non-functional requirements (latency, availability, consistency). Estimate scale: daily active users, tweets per second, read/write ratio, and storage needs.

2. Design Data Model and APIs

Define core entities (User, Tweet, Follow, Like, Retweet, Reply) and their relationships. Sketch key APIs (e.g., POST /tweet, GET /timeline) and choose appropriate storage: SQL for user data, NoSQL or graph DB for social graph, and time-series or wide-column store for tweets.

3. Design Timeline Generation Strategy

Compare fan-out on write (push) vs. fan-out on read (pull) vs. hybrid. Discuss how to handle the celebrity problem, and design the home timeline service with caching (e.g., Redis) for fast retrieval.

4. Address Interactions and Consistency

Design how likes, retweets, and replies are stored and counted (e.g., counters in Redis, eventual consistency). Discuss how replies form threads and how retweets appear in timelines.

5. Discuss Scaling, Availability, and Trade-offs

Cover partitioning (sharding by user ID), replication, caching layers, and CDN for media. Explain trade-offs between consistency and availability (CAP theorem), and how to handle failures and hot spots.

Key Points to Mention

  • Fan-out on write vs. fan-out on read and the hybrid approach for celebrities
  • Data storage choices: SQL for user profiles, NoSQL for tweets, graph DB for social graph
  • Caching strategies for timelines (e.g., Redis) and precomputed timelines
  • Handling high read throughput with read replicas and CDN for media
  • Eventual consistency for likes/retweets counts and idempotent operations
  • Sharding and partitioning strategies to scale horizontally

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

Q2

How would you handle non-functional requirements like low-latency timeline reads and eventual consistency for fanout at hundreds of millions of users?

System DesignTechnical Trade-offs
Author's notes

This came naturally out of the main design question but they pushed on it separately.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and specific non-functional requirements (latency targets, consistency tolerance). Then propose a hybrid architecture that separates the write path (fanout) from the read path (timeline), using asynchronous processing and caching to meet low-latency reads while accepting eventual consistency for fanout. Finally, discuss trade-offs and mitigation strategies like idempotency, deduplication, and monitoring.

Pro tip: Acknowledge that perfect consistency at this scale is impractical; instead, focus on defining acceptable staleness bounds and designing for graceful degradation. Show you understand that user experience often tolerates eventual consistency if the timeline is mostly up-to-date.

1. Clarify Requirements and Scale

Ask about expected read latency (e.g., <100ms), write throughput, and how stale the timeline can be. Confirm the scale of hundreds of millions of users and the fanout ratio (e.g., average followers per user).

2. Design Write Path for Scalability

Propose an asynchronous fanout service that processes events from a queue (e.g., Kafka) and writes to each follower's timeline store. Use partitioning and sharding to distribute load, and consider a hybrid push-pull model for celebrities.

3. Optimize Read Path for Low Latency

Store precomputed timelines in a low-latency data store (e.g., Redis, Cassandra) with appropriate indexing. Use caching (CDN, in-memory) and read replicas to serve reads quickly, and consider denormalization for fast access.

4. Address Eventual Consistency and Trade-offs

Explain that fanout is eventually consistent: writes propagate asynchronously, so timelines may lag. Discuss how to handle conflicts (e.g., last-write-wins, vector clocks) and ensure idempotency to avoid duplicates.

5. Monitor and Mitigate Issues

Propose monitoring for fanout lag, error rates, and latency. Implement backpressure, retries with exponential backoff, and dead-letter queues. Consider fallback to pull-based model during outages.

Key Points to Mention

  • Asynchronous fanout using message queues (e.g., Kafka) to decouple write and read paths
  • Hybrid push-pull model: push for normal users, pull for celebrities to avoid write amplification
  • Low-latency storage: Redis or Cassandra for timeline caching, with read replicas and CDN
  • Eventual consistency: define staleness bounds, use idempotent writes and deduplication
  • Trade-offs: consistency vs. availability (CAP theorem), latency vs. cost
  • Monitoring and observability: track fanout lag, error rates, and latency percentiles

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 to support follow/unfollow and timeline generation at scale?

System DesignData Modeling
Author's notes

Talked through adjacency list storage in a relational DB with a separate graph store for traversal at scale.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and requirements (e.g., number of users, read/write ratio, latency SLAs), then propose a hybrid storage approach: a graph database or adjacency lists for the social graph, and a denormalized timeline cache for fast reads. Discuss trade-offs between push (fan-out on write) and pull (fan-out on read) models, and how to handle celebrities or high-degree nodes.

Pro tip: Mention that you would use a hybrid fan-out strategy: push for normal users and pull for celebrities, and that you would leverage a distributed cache like Redis for timeline storage with a fallback to a durable store like Cassandra. This shows you understand real-world trade-offs at 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 storing the graph as adjacency lists in a distributed database (e.g., Cassandra) or a graph database (e.g., Neo4j). Discuss partitioning by user ID and using composite keys for follow relationships.

3. Choose a Timeline Generation Strategy

Compare push (fan-out on write) vs. pull (fan-out on read) models. Recommend a hybrid approach: push for most users, pull for high-degree users (celebrities) to avoid write amplification.

4. Implement Caching and Storage for Timelines

Use a fast in-memory store like Redis to cache precomputed timelines for active users, with a durable store (e.g., Cassandra) for persistence. Discuss TTL and eviction policies.

5. Address Consistency and Scalability

Explain how to handle eventual consistency, idempotent operations for follow/unfollow, and sharding strategies. Mention monitoring and backpressure to handle spikes.

Key Points to Mention

  • Adjacency list vs. graph database trade-offs
  • Push vs. pull vs. hybrid fan-out models
  • Partitioning and sharding strategies for the social graph
  • Caching layers (e.g., Redis) for timeline reads
  • Handling high-degree nodes (celebrities) to avoid write amplification
  • Eventual consistency and idempotency for follow/unfollow operations

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