Doordash Software Engineer 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 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...
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 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...
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 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...
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...
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 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...
Design a single-machine LRU cache
Design an in-memory LRU cache for a single machine using a hash map and a doubly linked list to support O( 1) get and put. Explain how you handle capa...
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...
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...
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...
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...
Design dynamic connectivity with alive nodes
Design a data structure to maintain an undirected graph of N nodes, where each node has a boolean 'alive' flag. Support the following operations effic...
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...