Doordash Coding & Algorithms Interview Questions
DoorDash Coding & Algorithms interview questions typically emphasize practical problem solving under time pressure, clear code, and product-minded tradeoffs. What’s distinctive is a bias toward realistic engineering tasks—scheduling, graph traversal, and array/string manipulation appear often—combined with an expectation that you communicate tradeoffs, test edge cases, and iterate quickly. Interviewers assess algorithmic thinking, correctness, complexity reasoning, and the ability to refactor or extend solutions when given follow-ups. Expect an initial technical screen followed by a loop of 2–4 interviews that blend live coding with behavioral and sometimes system-design conversations. For interview preparation, prioritize consistent timed practice on medium-to-hard problems, rehearse speaking your thought process, and run mock interviews in your target language and editor. Refresh core data structures, common patterns (DFS/BFS, two pointers, heaps, hash maps, dynamic programming), and time/space analysis. Finish prep by practicing end-to-end: state assumptions, outline an approach, code defensively, and validate with tests so you can both solve and clearly explain your solutions during the loop.
Compute courier pay and implement load balancing
Problem 1: Compute courier (delivery driver) pay You are given a sequence of delivery-related events for a courier during a day. Your task is to compu...
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: - ...
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...
Debug round-robin, DashMap, and simple cache
You are given a service that routes requests to a list of nodes, each marked as either available or unavailable. The pickNode() function is intended t...
Debug a driver assignment bug
Given a service that selects the best delivery driver ("dasher") for an order, users report incorrect assignments. With a provided codebase and failin...
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 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...
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...
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...
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...
Find closest value to a target in a BST
Problem Given the root of a binary search tree (BST) and a floating-point number target, return the value in the BST that is closest to target. If the...
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...
Debug and refactor a legacy module
Given a legacy module named DasherPicker and a failing test suite, systematically debug and refactor the code while following a provided review checkl...
Generate the next lexicographic array arrangement
Given an integer array nums that may include negative numbers and duplicates, modify nums in place to produce the next sequence in lexicographic order...
Compute nearest courier for each customer
You are given two arrays: customers and dashers. Each customer i has coordinates (xi, yi). Each dasher j has coordinates (aj, bj) and an integer id. F...
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...
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...
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 a hierarchical path registry
Implement an in-memory hierarchical path registry. Support: create(path, value) to create a new path with an integer value and get(path) to return its...