FastPrepOpen Restaurants in a City Range
Problems/Open Restaurants in a City Range

Open Restaurants in a City Range

DoorDash logoDoorDash● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report names the checks that decide whether a restaurant is eligible. It does not say how coordinates work, where the range edge falls, what order the output is in, the number limits, the function signature, or the examples. We chose those. Our version is about 88% the same as the reported question.

Task

A city range is described by an integer center (cityX, cityY) and a non-negative integer radius. Restaurant records are supplied through equal-length arrays: restaurantIds[i], restaurantX[i], restaurantY[i], and isOpen[i] describe one restaurant.

A restaurant is eligible exactly when isOpen[i] is true and its squared Euclidean distance from the city center is at most radius * radius.

Return the identifiers of all eligible restaurants in their original input order.

Function

findOpenRestaurants(cityX: int, cityY: int, radius: int, restaurantIds: String[], restaurantX: int[], restaurantY: int[], isOpen: boolean[]) → String[]

Examples

Example 1

cityX = 0cityY = 0radius = 5restaurantIds = ["alpha","bravo","charlie","delta"]restaurantX = [3,5,1,0]restaurantY = [4,1,1,6]isOpen = [true,true,false,true]return = ["alpha"]

alpha is open and lies exactly on the radius-five boundary. bravo and delta are outside the circle, while charlie is closed.

Example 2

cityX = 10cityY = -2radius = 3restaurantIds = ["north","center","west"]restaurantX = [10,10,7]restaurantY = [1,-2,-2]isOpen = [true,true,true]return = ["north","center","west"]

All three restaurants are open. The first and third lie exactly on the boundary, and the second is at the city center, so input order is preserved.

Example 3

cityX = 4cityY = 7radius = 0restaurantIds = []restaurantX = []restaurantY = []isOpen = []return = []

There are no restaurant records, so the result is empty.

Constraints

  • 0 <= restaurantIds.length <= 100000
  • restaurantX.length, restaurantY.length, and isOpen.length equal restaurantIds.length.
  • Every restaurant identifier is non-empty.
  • -10^6 <= cityX, cityY, restaurantX[i], restaurantY[i] <= 10^6
  • 0 <= radius <= 2 * 10^6

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
  • 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

  • Starlink Beam PlannerSpaceX · OA · PHONE SCREENSpaceX interview questions
  • Find All Points Within a RadiusGoogle · PHONE SCREENGoogle interview questions
  • Max Points on a LineUber · PHONE SCREENUber interview questions
  • Closest Pair of PointsCitadel · PHONE SCREENCitadel interview questions
  • Detonate Bombs with Chain ReactionsAirbnb · PHONE SCREENAirbnb interview questions
  • The k Points Nearest the OriginAdobe · PHONE SCREENAdobe interview questions
  • K Closest Points to the OriginWhatNot · PHONE SCREENWhatNot interview questions
  • Maximum Visible DronesAnduril · PHONE SCREENAnduril interview questions
  • K Closest Points to the OriginSambaNova Systems · PHONE SCREENSambaNova Systems interview questions
  • Coordinate Bounding BoxUpstart · OAUpstart interview questions

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[] findOpenRestaurants(int cityX, int cityY, int radius, String[] restaurantIds, int[] restaurantX, int[] restaurantY, boolean[] isOpen) {
        // Write your code here
    }
}
Checking account…