DevsUnite

DoorDash Interview Questions

17 real coding interview questions recently asked at DoorDash, spanning Algorithms, with a real difficulty tag and a direct LeetCode link for every question.

By DevsUnite · 17 Problems

Total Problems: 17Difficulty Levels:EasyMediumHard

Loading your progress…0/17
Walls and Gates
LeetCodeMedium

A multi-source BFS problem: given a grid of walls, gates, and empty rooms, fill each empty room with its distance to the nearest gate. The efficient approach starts BFS simultaneously from all gates at once (pushing every gate into the queue before starting) rather than running a separate BFS per gate, since single-source BFS from each gate independently would be far slower. It's a good test of recognizing when a problem calls for multi-source BFS instead of the more commonly reached-for single-source version.

Shortest Distance from All Buildings
LeetCodeHard

A harder grid BFS problem: find the empty cell whose sum of distances to every building is minimized, where distance can only be measured through empty cells (walking around obstacles). The standard approach runs a full BFS from each building, accumulating a total-distance and reachable-count grid, and only considers candidate cells reachable from every building. It's a strong test of aggregating results across multiple independent BFS runs and correctly filtering for cells that satisfy a constraint from all of them simultaneously.

01 Matrix
LeetCodeMedium

Another multi-source BFS problem: for every cell in a binary matrix, find the distance to the nearest 0. As with Walls and Gates, the efficient solution seeds the BFS queue with all 0-cells at once and expands outward in layers, rather than computing a separate BFS from each 1-cell. It's frequently used alongside similar multi-source BFS problems to confirm the pattern is genuinely understood, not just memorized for one specific problem phrasing.

Maximum Profit in Job Scheduling
LeetCodeHard

This is a weighted interval scheduling problem: sort jobs by end time, then use dynamic programming where each state answers 'what's the best profit using jobs up to index i,' combined with binary search to quickly find the latest job that doesn't overlap with the current one. It tests whether a candidate can recognize a scheduling problem as DP-with-binary-search rather than reaching for a greedy or brute-force solution, and it's a natural extension of simpler interval-merging problems into an optimization setting.

Binary Tree Maximum Path Sum
LeetCodeHard

A hard tree problem: find the maximum sum of any path between any two nodes in a binary tree, where the path need not pass through the root. It tests whether a candidate can write a DFS that returns the best single-branch sum upward to a parent (for the recursive contract) while separately tracking a global maximum that considers both branches meeting at the current node. It's a well-known hard-tier tree-recursion problem precisely because those two concerns are easy to conflate.

Basic Calculator
LeetCodeHard

A harder stack-based expression evaluator than Basic Calculator II: this version must also handle parentheses and unary +/- signs, not just left-to-right operator precedence. The standard approach uses a stack to save the running result and sign whenever a '(' is entered, restoring and combining them on ')'. It's a strong test of careful state management through nested scopes and sign-handling edge cases under time pressure.

Longest Increasing Path in a Matrix
LeetCodeHard

A hard problem: find the length of the longest strictly increasing path in a matrix, moving in four directions. It tests whether a candidate can combine DFS with memoization — treating each cell's longest path as a subproblem cached to avoid recomputation — effectively turning the matrix into a DAG (since values only increase along a path) that supports dynamic programming. It's a good signal for recognizing when grid traversal needs memoization to avoid exponential blowup.

Koko Eating Bananas
LeetCodeMedium

A binary-search-on-the-answer problem: find the minimum eating speed that lets Koko finish all banana piles within h hours. Because a higher speed always finishes in fewer-or-equal hours (a monotonic relationship), the candidate binary searches over possible speeds and uses an O(n) greedy check (summing ceil(pile/speed) for each pile) to test feasibility at each candidate speed. It's a frequently reused pattern-recognition test for spotting monotonic feasibility problems that don't look like a search problem on the surface.

Search Suggestions System
LeetCodeMedium

A trie-or-sorted-array problem: as a user types a search word character by character, return up to three lexicographically smallest matching product suggestions after each character typed. It can be solved either by building a trie and walking it as characters are typed, or more simply by sorting the product list and binary-searching for the valid prefix range at each step. It's a practical test of combining prefix matching with an incremental, per-character query pattern, similar to real autocomplete systems.

Find K Closest Elements
LeetCodeMedium

Given a sorted array, find the k closest elements to a target value, returned in sorted order. The efficient solution binary searches for the left boundary of the optimal window of size k, comparing distances at the window's edges to decide which direction to shrink toward, rather than computing distances for every element and sorting. It's a good test of adapting binary search to a windowed-selection problem instead of the more familiar single-value-lookup use case.

Ways to Make a Fair Array
LeetCodeMedium

A prefix/suffix-sum problem: for each index, determine whether removing that element would make the sums of odd-indexed and even-indexed elements equal in the resulting array. The efficient approach precomputes running odd/even prefix and suffix sums, then for each candidate removal recombines them in O(1) instead of rebuilding the array and rescanning each time. It tests whether a candidate can maintain and combine multiple prefix aggregates cleanly rather than falling back to an O(n^2) brute-force removal check.

Check if One String Swap Can Make Strings Equal
LeetCodeEasy

An Easy-difficulty string-comparison problem: determine whether exactly one swap of two characters within one string can make it equal to another same-length string. The solution just needs to count and compare the mismatched positions — if there are zero mismatches (already equal, and a swap of identical characters is allowed) or exactly two mismatches that are each other's mirror, the answer is true. It's typically used as a quick, low-friction warm-up to confirm careful edge-case handling before moving to harder problems.

Largest Rectangle in Histogram
LeetCodeHard

A classic hard monotonic-stack problem: find the largest rectangular area that can be formed within a histogram's bars. The efficient O(n) solution maintains a stack of increasing bar heights and, whenever a shorter bar is encountered, pops and computes the area of each taller bar using the current index as the right boundary and the new stack top as the left boundary. It's one of the most commonly cited tests of genuine monotonic-stack fluency, since the naive approach is O(n^2) and the stack-based trick isn't obvious without prior exposure to the pattern.

Making A Large Island
LeetCodeHard

A harder follow-up to Number of Islands: first label each existing island via DFS/BFS and record its size, then for every water cell, check which distinct island labels are adjacent to it and sum their sizes plus one to see if flipping that cell creates a larger island. The key subtlety is deduplicating island labels around a single water cell so the same island isn't counted twice. It's a good test of whether a candidate can compose two passes of grid traversal — component labeling followed by a targeted second scan — rather than trying to solve everything in one pass.

Design HashMap
LeetCodeEasy

A from-scratch data structure design problem: implement a hash map's put/get/remove without using any built-in map type. The typical solution allocates a fixed-size array of buckets, each holding a small linked list (or array) of key-value pairs for separate chaining, with a simple hash function mapping keys to bucket indices. It's a foundational test of whether a candidate actually understands how the hash maps they use every day work internally, including collision handling.

Jump Game
LeetCodeMedium

Given an array of maximum jump lengths from each position, this asks whether the last index is reachable from the first. The efficient solution is a single greedy left-to-right pass tracking the farthest index reachable so far, rather than exploring all possible jump sequences. It's a clean test of whether a candidate can replace an exponential search-space approach with a greedy O(n) argument and justify why the greedy choice is safe.

Longest Common Prefix
LeetCodeEasy

A warm-up string problem: find the longest prefix shared by every string in an array. It's usually solved by either scanning character-by-character down the strings (vertical scanning) or comparing strings pairwise while progressively shrinking the prefix (horizontal scanning), and can also be done with a trie for larger inputs. It's a good early signal for whether a candidate handles edge cases cleanly — empty arrays, single-character strings, and no common prefix at all — rather than testing deep algorithmic insight.

Log in to save your progress, favorites, and notes to your account.

Frequently asked questions

What coding interview questions does DoorDash ask?

This page tracks 17 real, recently reported DoorDash coding interview questions, organized by topic: Algorithms.

How many DoorDash interview questions are on this list?

17 questions in total: 3 Easy, 7 Medium, and 7 Hard, each linked to its real LeetCode problem page.

Is it free to use?

Yes. Browsing every problem on this page is completely free, with no account required. Creating a free DevsUnite account lets you save your checked-off progress, star favorites, and add personal notes that sync across devices.

Do I need an account to track my progress?

You can read and solve every problem without logging in. An account is only required to mark a problem as done, star it, or add a note. Those actions save to your account instead of resetting on refresh.