DoorDash data scientist interviews test statistical reasoning, ML model design, SQL proficiency, A/B testing methodology, and Python-based algorithm implementation.
userId, you...Input: Stringm × n board representing a delivery area. The board contains: - 'X' - blockers (obstacles) - 'D' - DashMarts...Input: Listkey: identifier for the menu...Input: ListLocationIndex class that stores a set of named points on a 2D grid. The constructor takes three arrays: names (list of location name...Input: 2D gridm x n matrices: coverage and demand. A cell in demand is active if its value is 1. Active cells that are...Input: Number(s)template string consisting only of the characters '0', '1', and '?', and a list of integers run_lengths. A '?' in the...Input: Array of integersvalues. At each step, identify all eligible values: a value is eligible if it is strictly greater than...Input: ListDirectoryRegistry class that manages a hierarchical key-value store modeled as a tree of paths. The root path "/" always exists with...Input: Stringrecords, a list of ride events. Each record is a list of three strings: [ride_id, timestamp, status]. Possible statuses are...Input: Liststart time and an end time, generate all meeting check-in slots at 5-minute intervals after start up to and including end. The...Input: Listkey...Input: Listclass DynamicPricing: def __init__(self): initializes the dynamic pricing model.def set_demand(self, area: str, demand: int) -> None: sets the demand level for an area.def set_supply(self, area: str, supply: int) -> None: sets the supply level for an area.def calculate_price(self, area: str) -> float: returns the calculated price based on current demand and supply levels.Example 1: class RecommendationSystem: def __init__(self): initializes the recommendation system.def add_order(self, user_id: int, item_id: int) -> None: adds an order to the system.def recommend(self, user_id: int) -> List[int]: suggests items based on similar user orders.Example 1: (user_id=1, item_id=101) (user_id=1, item_id=102) Item 102 [] def max_density(delivery_times: List[int], target: int) -> int: - Returns the highest feasible restaurant density.Example 1: [3, 1, 4, 2, 2, 5], target = 3 2 [5, 3, 6, 9, 2], target = 5 1 1 <= len(delivery_times) <= 100000 1 <= delivery_times[i] <= 10000 1 <= target <= 10000k continuous segments using a sliding window approach.def min_delivery_time(route: List[int], k: int) -> int: - Returns the minimum time for k continuous segments.Example 1: [2, 3, 1, 5, 3, 7, 2], k = 3 6 [1, 5, 3] provide the minimum delivery time of 6.Example 2: [4, 2, 6, 3, 5], k = 2 5 [2, 3] provide the minimum delivery time of 5.Constraints: 1 <= len(route) <= 100000 1 <= route[i] <= 1000 1 <= k <= len(route)Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free