DoorDash Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Determine equality after limited swaps
Question LeetCode 1790. Check if One String Swap Can Make Strings Equal Follow-up: Given two strings, determine if they can become anagrams of each ot...
Count changed nodes in N-ary trees
Question Given two N-ary trees (old and new versions) where each node has a key (string), value (int), and list of children, compute how many nodes ar...
Find names similar by one swap
Question LeetCode 859. Buddy Strings – Given a target string and a list of strings, return all list entries that can match the target by swapping at m...
Implement string-path file system operations
Question LeetCode 1166. Design File System – extended to support Create(path, value), Get(path), Set(path, value) and Delete(path) with validation rul...
Compute cart total with best promotion
Assume you are implementing a checkout price calculator for an online shopping cart. You are given: - A list of items in the cart. Each item has: - ...
Find longest common ordered restaurant list
You have two delivery drivers who each have a pickup plan represented as a list of restaurant IDs (strings). Because there is only one car, the combin...
Implement minimum window substring with counts
Implement min_window_with_counts(s, t) Task Write a function: - min_window_with_counts(s: str, t: str) -> tuple[int, int] that returns the inclusive (...
Compute Differences Between Catalog Trees
You are given two rooted catalog trees. Each node has a unique string key among its siblings and an associated value. Compare the two trees and return...
Implement dasher active-time calculator
Implement a function that, given a dasherId, a local pay-period interval [startLocalDateTime, endLocalDateTime), and a list of order events of the for...
Implement and compare round-robin and consistent hashing
Implement a round-robin load balancer that selects among service nodes, skipping unavailable nodes and wrapping around correctly. Fix typical pitfalls...
Find nearest courier for each customer
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 dist...
Implement string pattern matching
Implement a function that finds the first occurrence of a pattern P in a text T and returns the starting index (or -1 if not found). Follow-ups: compa...
Generate the next lexicographic ordering
Given an array of integers, rearrange the elements in-place to form the next sequence in lexicographic order relative to the current arrangement; if n...
Find the nearest city sharing axis
You are given N cities, each with a unique name and integer coordinates (x, y). For any query city, return the nearest city that shares either the sam...
Debug using logs and allocate tasks
You inherit a service where unit tests pass locally, but production logs show intermittent errors. Without a debugger, outline a step-by-step debuggin...
Design dasher-to-order assignment algorithm
You are building a real-time 'dasher picker' that assigns delivery drivers (Dashers) to incoming orders. Define objective(s) (e.g., minimize ETA and c...
Implement round-robin load balancer
Implement a load balancer that distributes incoming requests across N backend servers in strict round-robin order. Requirements: ( 1) Support addServe...
Compute nearest dashmart distances for queries
You are given an m x n grid where each cell is one of: -1 for a wall (impassable), 0 for a dashmart (a store), and INF = 2^31 - 1 for an empty room. M...
Implement image carousel with comments and upvotes
Implement an image carousel that supports: 1) cycling forward/backward and autoplay with a configurable interval; 2) a per-image comment thread with c...
Compute delivery times on a grid
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 righ...