41 practice questions for DoorDash Data Scientist interviews
DoorDash data scientist interviews test statistical reasoning, ML model design, SQL proficiency, A/B testing methodology, and Python-based algorithm implementation.
Category: String coding problem# Question You are tasked with implementing a Bootstrap API that aggregates data from multiple services for a given user. Given a userId, you...Input: String Output: Computed result
codingHardVerified Question#2
2. Code Craft - Driver Payment System
Category: Algorithm coding problem# Question You are in charge of implementing the Dasher payment model. Given the sequence of accepted/fulfilled order activities from a given dasher...Input: List Output: Computed result
codingMediumVerified Question#3
3. Find Closest Dasher
Category: Algorithm coding problem# Question You are given an m × n board representing a delivery area. The board contains: - 'X' - blockers (obstacles) - 'D' - DashMarts...Input: List Output: Integer
codingMediumVerified Question#4
4. Find Menu Changes
Category: Tree coding problem# Question You are given two tree structures representing an old menu and a new menu. Each tree node has: - key: identifier for the menu...Input: List Output: Computed result
codingMediumVerified Question#5
5. Location Index
Category: Graph coding problemImplement a LocationIndex class that stores a set of named points on a 2D grid. The constructor takes three arrays: names (list of location name...Input: 2D grid Output: Computed result
codingMediumVerified Question#6
6. Covered Service Zones
Category: Algorithm coding problemYou are given two binary m x n matrices: coverage and demand. A cell in demand is active if its value is 1. Active cells that are...Input: Number(s) Output: Integer
codingHardVerified Question#7
7. Wildcard Segment Counter
Category: String coding problemYou are given a template string consisting only of the characters '0', '1', and '?', and a list of integers run_lengths. A '?' in the...Input: Array of integers Output: Computed result
codingMediumVerified Question#8
8. Peak Value Processing Order
Category: Algorithm coding problemYou are given a list of unique integers values. At each step, identify all eligible values: a value is eligible if it is strictly greater than...Input: List Output: Computed result
codingHardVerified Question#9
9. Directory Registry
Category: Tree coding problemImplement a DirectoryRegistry class that manages a hierarchical key-value store modeled as a tree of paths. The root path "/" always exists with...Input: String Output: Computed result
codingHardVerified Question#10
10. Ride Earnings Calculator
Category: String coding problemYou are given records, a list of ride events. Each record is a list of three strings: [ride_id, timestamp, status]. Possible statuses are...Input: List Output: Computed result
codingMediumVerified Question#11
11. Meeting Slot Generator
Category: Interval-based coding problemGiven a start time and an end time, generate all meeting check-in slots at 5-minute intervals after start up to and including end. The...Input: List Output: Computed result
codingMediumVerified Question#12
12. Catalog Tree Diff Counter
Category: Tree coding problemYou are given two n-ary trees representing an old and a new version of a product catalog. Each node in the tree has the following fields: - key...Input: List Output: Computed result
codingHardbinary search#1
1. [OA] Binary Search — Find optimal restaurant density
To improve delivery efficiency, DoorDash wants to analyze how many restaurants per square mile lead to faster delivery times. This problem can be approached using binary search over a range of possible densities. Problem statement: Given an array of integers where each integer denotes the delivery time for different restaurant densities, and an integer target that represents the maximum acceptable delivery time, find the highest restaurant density that results in a delivery time less than or equal to the target. Method Signature:def max_density(delivery_times: List[int], target: int) -> int: - Returns the highest feasible restaurant density.Example 1: Input: [3, 1, 4, 2, 2, 5], target = 3 Output: 2 Explanation: A density of 2 corresponds to delivery times within the acceptable limit.Example 2: Input: [5, 3, 6, 9, 2], target = 5 Output: 1 Explanation: The best density maintaining a delivery time under or equal to the target is 1.Constraints: - 1 <= len(delivery_times) <= 100000 - 1 <= delivery_times[i] <= 10000 - 1 <= target <= 10000
codingHardsliding window#2
2. [OA] Sliding Window — Optimize delivery time for DoorDash orders
In the fast-paced world of food delivery, DoorDash aims to minimize delivery times while optimizing routes based on real-time traffic data. This involves keeping track of delivery estimates dynamically based on recent data. Problem statement: Given an array of integers representing the time taken for each segment of a route, return the minimum time required to complete the delivery after analyzing k continuous segments using a sliding window approach. Method Signature:def min_delivery_time(route: List[int], k: int) -> int: - Returns the minimum time for k continuous segments.Example 1: Input: [2, 3, 1, 5, 3, 7, 2], k = 3 Output: 6 Explanation: The segments [1, 5, 3] provide the minimum delivery time of 6.Example 2: Input: [4, 2, 6, 3, 5], k = 2 Output: 5 Explanation: The segments [2, 3] provide the minimum delivery time of 5.Constraints: - 1 <= len(route) <= 100000 - 1 <= route[i] <= 1000 - 1 <= k <= len(route)