FastPrepWarehouse Order Prioritization
Problems/Warehouse Order Prioritization

Warehouse Order Prioritization

DoorDash logoDoorDash● MediumFULLTIMEPHONE SCREEN

Updated Dec 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported from a DoorDash technical phone screen for a full-time senior backend software engineering role, by a candidate who was changing jobs; a recruiter set up the process. The poster calls the round code craft. It began with about five minutes of introductions and ended with five minutes of questions and answers.

The task was a small API for a warehouse: given a warehouse ID, it calls outside services for that warehouse's orders and for the dasher's ETA of each order, then returns the two orders that should be packed first, those with the earliest ETAs. After the first version, most of the time went to follow-up questions about the code. One asked how the result should treat an order whose ETA lookup fails; the report does not say what answer was given. Others were about making the code faster in practice, what can go wrong with a cache, how to manage thread pools and timeouts when ETAs are looked up in parallel, and how to lower tail latency. Finally the candidate was asked to change the one-by-one ETA lookups into a multithreaded version; the report does not say how that went. This problem covers the first version, with our own rule for failed lookups; the other follow-ups are not part of it.

The report gives no input format, limits or examples. Passing the two services' replies in as arrays (the order list as [orderId, warehouse] rows and one [orderId, eta] row per order, with FAILED for a failed lookup), ranking failed lookups after every known ETA, breaking ties by position in the order list, returning fewer than two IDs when the warehouse has fewer orders, the limits and the examples are our choices.

Our version is about 80% the same as the reported question.

A delivery company packs orders in its warehouses before dashers (its delivery drivers) pick them up. Given the ID warehouseId of one warehouse, choose the two orders of that warehouse that should be packed first: the ones whose dashers are expected to arrive soonest.

In a real system this data would come from two other services. Here their replies are passed in as arrays:

  • orders is the reply of the order service. Each row [orderId, warehouse] is one order and the warehouse it belongs to. The orders of the requested warehouse are the rows whose second value is exactly equal to warehouseId.
  • etaReplies holds the reply of the ETA service for every order in orders, in any order. Each row [orderId, eta] gives the dasher's expected arrival time in minutes as a decimal string, or the string "FAILED" if the lookup for that order did not succeed.

Rank the orders of the requested warehouse. An order with a known ETA goes before every order whose lookup failed; a failed order is still ranked, just behind all known ETAs. Known ETAs are compared as numbers, smaller first. When two orders have the same ETA, or both lookups failed, the one that appears earlier in orders goes first.

Return the IDs of the first two orders in this ranking, best first. If the warehouse has only one order, return just that ID; if it has no orders, return an empty list.

Function

prioritizeOrders(warehouseId: String, orders: String[][], etaReplies: String[][]) → String[]

Examples

Example 1

warehouseId = "W2"orders = [["A1","W2"],["A2","W1"],["A3","W2"],["A4","W2"],["A5","W2"]]etaReplies = [["A3","9"],["A1","25"],["A5","FAILED"],["A2","3"],["A4","12"]]return = ["A3","A4"]

Warehouse W2 has orders A1, A3, A4 and A5; A2 belongs to W1, so its ETA of 3 does not count. The known ETAs are 25 for A1, 9 for A3 and 12 for A4, and the lookup for A5 failed. The two smallest ETAs are 9 and 12, so the answer is ["A3","A4"].

Example 2

warehouseId = "SEA-1"orders = [["B4","SEA-1"],["B8","SEA-1"],["B1","SEA-1"]]etaReplies = [["B1","FAILED"],["B8","30"],["B4","FAILED"]]return = ["B8","B4"]

Only B8 has a known ETA, so it comes first. The lookups for B4 and B1 both failed; they are tied, and B4 is listed before B1 in orders, so B4 is second.

Example 3

warehouseId = "W5"orders = [["X3","W5"],["X1","W5"],["X2","W5"]]etaReplies = [["X1","7"],["X2","4"],["X3","7"]]return = ["X2","X3"]

X2 has the smallest ETA, 4. X3 and X1 share ETA 7; X3 comes earlier in orders, so it takes the second place.

Constraints

  • 1 <= warehouseId.length <= 12
  • 0 <= orders.length <= 1000
  • orders[i].length == 2
  • etaReplies.length == orders.length and etaReplies[i].length == 2
  • Every warehouse ID and order ID has 1 to 12 characters, each an uppercase letter, a digit or -.
  • The order IDs in orders are distinct, and etaReplies has exactly one row for each of them.
  • Every ETA is either "FAILED" or a whole number from 0 to 10000 written without leading zeros.

More DoorDash Phone Screen questions

  • Dasher Pay with Store Waits and Peak HoursPHONE SCREEN · Seen Nov 2026
  • Customer Bootstrap APIPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Dasher Active TimePHONE SCREEN · Seen Sep 2026
  • Merchant Capacity Interval MergePHONE SCREEN · Seen Aug 2026
  • Open Restaurants in a City RangePHONE SCREEN · Seen Aug 2026
  • Closest DashMartOA · PHONE SCREEN · Seen Jul 2026
  • Maximize Total Profit by Assigning Chefs to DishesPHONE SCREEN · Seen May 2026
  • Minimum Batches Within a Time WindowPHONE SCREEN · Seen Feb 2026
  • Minimum Riders for Delivery IntervalsPHONE SCREEN · Seen Feb 2026
  • Return Priority of Order IDsPHONE SCREEN · Seen Jun 2025

Similar questions at other companies

  • Merge Accounts by Shared AttributeAmazon · PHONE SCREEN
  • Mutual-Friend Referral RecommendationsFireworks AI · PHONE SCREEN · ONSITE INTERVIEW
  • Mutual-Friend RecommendationsMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
  • Filter, Sort, and Deduplicate Scheduled TasksRippling · PHONE SCREEN · ONSITE INTERVIEWRippling interview questions
  • In-Memory Filesystem CommandsPerplexity AI · PHONE SCREEN · ONSITE INTERVIEWPerplexity AI interview questions
  • Log Analyzer: Busiest Service in a Rolling WindowByteDance · PHONE SCREENByteDance interview questions
  • User Journey PathsWhatNot · PHONE SCREEN · ONSITE INTERVIEWWhatNot interview questions
  • Merchant Payout Scheduler, Part 2: Per-Merchant SchedulesStripe · PHONE SCREENStripe interview questions
  • Longest Consecutive SequenceJP Morgan Chase · PHONE SCREENJP Morgan Chase interview questions
  • Top K Frequent Elements with a Recency TiebreakSwiggy · PHONE SCREEN

DoorDash interview experiences

  • DoorDash SWE Onsite: Donation System Design: 1 Experience
  • DoorDash SWE Phone Screen: Bootstrap API in Java: 1 Experience
  • DoorDash SWE Virtual Onsite: 1 Experience
  • DoorDash SWE Phone Screen: Bootstrap API Parsing: 1 Experience
  • DoorDash Senior SWE Onsite Interview Experience: 1 Experience
  • DoorDash AI CodeCraft Interview: 8 Experiences
All DoorDash interview questionsSee DoorDash hiring insights
Saved
class Solution {
    public String[] prioritizeOrders(String warehouseId, String[][] orders, String[][] etaReplies) {
        // Write your code here.
    }
}
Checking account…