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
DoorDash needs to determine the most popular restaurants within a geographical area. To accomplish this, a graph traversal algorithm can be applied to search for the connected components in the restaurant delivery network. Using n restaurants where each restaurant is a node connected by edges (deliverable routes), write a function that returns the number of connected components in the graph representing the available restaurants. Function Signature:def count_connected_components(n: int, edges: List[Tuple[int, int]]) -> int: - Returns the number of connected components in the given graph.Example 1: Input: n = 5, edges = [(0, 1), (1, 2), (3, 4)] Output: 2 Explanation: There are two connected components: {0, 1, 2} and {3, 4}. Constraints: - 1 <= n <= 10^4 - 0 <= len(edges) <= n*(n-1)/2
codingHardsliding window#2
2. [OA] Sliding Window — optimize the order delivery window for DoorDash's logistics
In order to maximize delivery efficiency, DoorDash needs to determine the optimal delivery window for a set of orders. By using a sliding window technique, we can minimize the time taken to deliver all orders without exceeding a certain capacity. Given an array of orders where each order contains the pickup_time and delivery_time, return the maximum number of orders that can be delivered within a given time_limit. Function Signature:def max_orders(orders: List[Tuple[int, int]], time_limit: int) -> int: - Returns the maximum number of orders that can be fulfilled within the given time limit.Example 1: Input: orders = [(1, 4), (2, 6), (3, 8), (5, 10)], time_limit = 8 Output: 3 Explanation: Orders (1, 4), (2, 6), and (3, 8) can be delivered within the time limit. Constraints: - 1 <= len(orders) <= 10^5 - 0 <= pickup_time < delivery_time <= 10^6 - 0 <= time_limit <= 10^6