← DoorDash Interview Insights

DoorDash·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

DoorDash coding screen focused on a grid traversal problem themed around their DashMart product. Pretty standard BFS territory but the domain-specific framing threw me off for a second.

Questions Asked (1)

Q1

Given a grid map with a Dasher at a starting cell and a DashMart at a known location, find the shortest path between them while handling non-traversable cells correctly.

Algorithms & Data Structures
Author's notes

My first instinct was Dijkstra but the grid was unweighted so BFS was obviously the right call.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the grid as a graph where each traversable cell is a node connected to its valid neighbors (up, down, left, right). Use BFS to find the shortest path because all edges have equal weight. If the grid has varying costs, use Dijkstra's algorithm with a priority queue.

Pro tip: Clarify with the interviewer whether diagonal moves are allowed and whether the grid has uniform costs. Also, discuss how to handle edge cases like no path existing or the start/end being blocked.

1. Clarify the problem

Ask about movement rules (4-directional vs 8-directional), cell costs (uniform or weighted), and constraints (grid size, obstacles). Confirm the output format (path length or actual path).

2. Choose the algorithm

For uniform costs, BFS is optimal. For weighted costs, use Dijkstra's algorithm. Mention that A* with a heuristic (e.g., Manhattan distance) can be more efficient if the grid is large.

3. Implement the search

Use a queue for BFS or a priority queue for Dijkstra. Track visited cells to avoid cycles. For path reconstruction, maintain a parent map.

4. Handle edge cases

Check if start or end is blocked, if no path exists, or if the grid is empty. Return -1 or an empty path as appropriate.

5. Analyze complexity

State time and space complexity: O(V+E) for BFS, where V is number of cells and E is number of edges (up to 4V). For Dijkstra, O(E log V).

Key Points to Mention

  • BFS guarantees shortest path in unweighted graphs.
  • Use a queue for BFS and a priority queue for Dijkstra.
  • Track visited cells to avoid infinite loops.
  • Reconstruct path using a parent map if needed.
  • Consider A* with Manhattan distance for optimization.
  • Handle edge cases: blocked start/end, no path, empty grid.

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