PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Coding & Algorithms/DoorDash

Find nearest courier for each customer

Last updated: Mar 29, 2026

Quick Overview

This question evaluates competence in spatial algorithms and data structures, specifically nearest-neighbor search, spatial indexing, numerical robustness, tie-breaking and complexity analysis for large-scale 2D point sets.

  • Medium
  • DoorDash
  • Coding & Algorithms
  • Software Engineer

Find nearest courier for each customer

Company: DoorDash

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

Given two sets of 2D points: customers C = {c1..cn} and active couriers D = {d1..dm}, return for every customer the nearest courier by geographic distance (assume Euclidean or great-circle; specify which). Provide an algorithm beyond the O(n*m) brute force, discuss appropriate spatial data structures (e.g., k-d tree, R-tree, uniform grid hashing), and analyze time and space complexity. Address tie-breaking, handling duplicate locations, and precision issues. Follow-ups: how would you support frequent dynamic updates to courier locations, batch queries, or constraints like maximum pickup radius?

Quick Answer: This question evaluates competence in spatial algorithms and data structures, specifically nearest-neighbor search, spatial indexing, numerical robustness, tie-breaking and complexity analysis for large-scale 2D point sets.

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
Onsite
Coding & Algorithms
8
0

Given two sets of 2D points: customers C = {c1..cn} and active couriers D = {d1..dm}, return for every customer the nearest courier by geographic distance (assume Euclidean or great-circle; specify which). Provide an algorithm beyond the O(n*m) brute force, discuss appropriate spatial data structures (e.g., k-d tree, R-tree, uniform grid hashing), and analyze time and space complexity. Address tie-breaking, handling duplicate locations, and precision issues. Follow-ups: how would you support frequent dynamic updates to courier locations, batch queries, or constraints like maximum pickup radius?

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.