PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/DoorDash

Compute delivery times on a grid

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of graph traversal and shortest-path algorithms, grid-based pathfinding, and data structure selection for representing sparse or large grids within the Coding & Algorithms domain.

  • Medium
  • DoorDash
  • Coding & Algorithms
  • Software Engineer

Compute delivery times on a grid

Company: DoorDash

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

You are given a 2D grid with cells marked as 'M' (warehouses), 'C' (customers), 'X' (obstacles), and '.' (roads). You can move up, down, left, or right with cost 1 per step. For each customer cell, compute the minimum number of steps from any warehouse; return -1 if unreachable. Define the input/output format and justify your data structures. Follow-ups: handle millions of cells efficiently (memory/time); support non-uniform road costs (convert to Dijkstra); and return actual paths for a subset of customers.

Quick Answer: This question evaluates understanding of graph traversal and shortest-path algorithms, grid-based pathfinding, and data structure selection for representing sparse or large grids within the Coding & Algorithms domain.

Related Interview Questions

  • Maximize Chef Assignment Profit - DoorDash (medium)
  • Compute Courier Delivery Pay - DoorDash (easy)
  • Compute Nearest Destination Distances - DoorDash (easy)
  • Count changed nodes between two menu trees - DoorDash (hard)
  • Calculate Daily Driver Pay - DoorDash (hard)
DoorDash logo
DoorDash
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
7
0

You are given a 2D grid with cells marked as 'M' (warehouses), 'C' (customers), 'X' (obstacles), and '.' (roads). You can move up, down, left, or right with cost 1 per step. For each customer cell, compute the minimum number of steps from any warehouse; return -1 if unreachable. Define the input/output format and justify your data structures. Follow-ups: handle millions of cells efficiently (memory/time); support non-uniform road costs (convert to Dijkstra); and return actual paths for a subset of customers.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More DoorDash•More Software Engineer•DoorDash Software Engineer•DoorDash Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.