FastPrepReturn Priority of Order IDs
Problems/Return Priority of Order IDs

Return Priority of Order IDs

DoorDash logoDoorDash● MediumPHONE SCREEN

Updated Sep 2026

QuestionFunctionExamples

Problem statement

Given a list of ints representing order IDs, return the priority of the order IDs based on the values of their neighbors. An order is considered if it's greater than it's neighbors to the left and right of it.

Function

getOrderPriorities(orderIds: List<Integer>) → List<Integer>

Complete the function getOrderPriorities in the editor.

getOrderPriorities has the following parameter:

  1. List orderIds: a list of integers representing order IDs

Returns List: the priority of the order IDs

Examples

Example 1

orderIds = [3, 5, 1, 4, 2]return = [4, 2, 5, 3, 1]

If we iterate over [3, 5, 1, 4, 2], the order IDs that can be considered in this first pass is 5 and 4. In this case, remove 4 because it's the order ID with the smallest value. The result of the removal looks like this: [3, 5, 1, 2] If we iterate over [3, 5, 1, 2], the order IDs that can be considered in this pass is 5 and 2. In this case, remove 2 because it's the order ID with the smallest value. The result of the removal looks like this: [3, 5, 1] Continue on from there until the list is empty

More DoorDash Phone Screen questions

  • Warehouse Order PrioritizationPHONE SCREEN · Seen Nov 2026
  • 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

Similar questions at other companies

  • Top K Frequent ElementsAmazon · OA · PHONE SCREEN · ONSITE INTERVIEW
  • Mutual-Friend RecommendationsMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
  • Tennis Court SchedulingAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
  • Maximum Number of Events That Can Be AttendedByteDance · PHONE SCREENByteDance interview questions
  • Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
  • Defer Expenses to Preserve BalanceDRW · PHONE SCREENDRW interview questions
  • Select the Top User MatchesDuolingo · PHONE SCREENDuolingo interview questions
  • Meeting Rooms IIQuince · PHONE SCREENQuince interview questions
  • Kth Largest Element in an ArrayLinkedIn · PHONE SCREENLinkedIn interview questions
  • Meeting Rooms IISecuronix · 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 List<Integer> getOrderPriorities(List<Integer> orderIds) {
      // write your code here
    }

}
Checking account…