← DoorDash Interview Insights

DoorDash·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

DoorDash SWE interview that was basically a coding round disguised as a design exercise. They gave me a filesystem-style key-value store to build from scratch and wanted real working code plus a complexity breakdown at the end.

Questions Asked (1)

Q1

Design and implement a hierarchical key-value store where keys are directory-style paths like /a/b/c. Support create, set, get, and delete operations with the constraints that root always exists, create requires the parent to exist, and delete only works on leaf nodes. Also discuss the time complexity of each operation.

System DesignAlgorithms & Data StructuresData Modeling
Author's notes

This felt like two questions jammed into one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and edge cases, then propose a tree-based data structure where each node represents a path component and stores a value if it's a leaf. Implement operations with careful handling of parent existence and leaf constraints, and analyze time complexity based on path depth and component length.

Pro tip: Discuss trade-offs between using a tree versus a hash map with path strings, and mention how to handle concurrent access if needed. Also, proactively bring up testing strategies for edge cases like root operations and deep paths.

1. Clarify Requirements and Constraints

Ask questions to confirm assumptions: Are keys case-sensitive? Can values be any type? What should happen if create is called on an existing path? Should delete be recursive? Clarify that root always exists and cannot be deleted.

2. Choose Data Structure

Propose a tree where each node has a map of child name to node, and an optional value. Alternatively, consider a hash map from full path to value, but explain why tree is better for hierarchical operations and constraints.

3. Design Operations

Detail each operation: create(path) checks parent exists and path doesn't exist, then adds node; set(path, value) requires path exists and is leaf; get(path) returns value if leaf; delete(path) removes leaf node if it has no children and is not root.

4. Analyze Time Complexity

For tree approach, each operation traverses the path components, so O(k) where k is number of components, assuming O(1) child lookup. Discuss space complexity O(total nodes). Compare with hash map approach O(1) average but O(L) for string hashing where L is path length.

5. Discuss Edge Cases and Extensions

Cover edge cases: root operations, creating under non-existent parent, deleting non-leaf, setting on non-leaf. Mention possible extensions: atomic operations, concurrency, persistence, or efficient listing of children.

Key Points to Mention

  • Tree node structure with children map and optional value
  • Path parsing by splitting on '/' and handling empty components
  • Parent existence check for create
  • Leaf-only constraint for set and delete
  • Time complexity O(k) per operation where k is path depth
  • Space complexity O(n) for n nodes
  • Trade-offs between tree and hash map implementations
  • Handling of root node as special case

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