← DoorDash Interview Insights

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

Senior
Jul 2026

Summary

DoorDash system design round focused entirely on consistent hashing. Pretty deep dive, more theory-heavy than I expected for a SWE role.

Questions Asked (1)

Q1

Design a consistent hashing system with APIs for adding a node (with weight), removing a node, and looking up which node owns a given key. Use virtual nodes to minimize remapping when the cluster changes.

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

This was the whole interview, basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then explain the hash ring with virtual nodes and weighted mapping. Walk through the API design and demonstrate how virtual nodes minimize remapping, and finally discuss trade-offs and edge cases.

Pro tip: Quantify the improvement: with V virtual nodes per physical node, adding/removing a node remaps only ~1/(N+1) of keys, and weights can be implemented by allocating virtual nodes proportionally. Mention that consistent hashing is used in production systems like Dynamo and Cassandra to show practical awareness.

1. Clarify requirements and scale

Ask about expected number of nodes, keys, read/write patterns, and consistency needs. Confirm that the system should minimize key remapping when nodes are added or removed.

2. Design the hash ring with virtual nodes

Explain mapping both nodes and keys to a circular hash space (e.g., 0 to 2^32-1). Introduce virtual nodes: each physical node is represented by multiple points on the ring to improve balance and enable weighting.

3. Define the APIs and data structures

Specify addNode(nodeId, weight), removeNode(nodeId), and getNode(key). Describe using a sorted structure (e.g., balanced BST or sorted array) for efficient lookup, and a map to track virtual nodes per physical node.

4. Explain lookup and remapping behavior

For getNode(key), hash the key and find the first virtual node clockwise on the ring. Show that adding/removing a node only affects keys in the adjacent arc, and with V virtual nodes, remapping is ~1/(N+1) of keys.

5. Discuss trade-offs and edge cases

Cover choice of V (balance vs. memory), handling node failures, replication, and potential hotspots. Mention alternatives like rendezvous hashing and when they might be preferable.

Key Points to Mention

  • Hash ring concept: mapping nodes and keys to a circular hash space.
  • Virtual nodes: multiple points per physical node for better load distribution and weighting.
  • Weighted nodes: allocate virtual nodes proportional to weight (e.g., weight * V).
  • Minimal remapping: only keys between the new/removed node and its predecessor are affected.
  • API design: addNode(nodeId, weight), removeNode(nodeId), getNode(key) with efficient lookup.
  • Trade-offs: number of virtual nodes vs. memory/overhead, and alternatives like rendezvous hashing.

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