DoorDash | L4 Software Engineer | NYC | September 2022 | Reject
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2022-09-28Added By Anonymous
Source: Link
Company: DoorDash
Role: L4 Software Engineer
Location: NYC
Date: September 2022
Outcome: Reject
Experience:
``` # A DashMart is a warehouse run by DoorDash that houses items found in convenience stores, grocery stores, and restaurants. We have a city with open roads, blocked-off roads, and DashMarts. # City planners want you to identify how far a location is from its closest DashMart. # You can only travel over open roads (up, down, left, right). # Locations are given in [row, col] format. # [ # # 0 1 2 3 4 5 6 7 8 # ['X', ' ', ' ', 'D', ' ', ' ', 'X', ' ', 'X'], # 0 # ['X', ' ', 'X', 'X', ' ', ' ', ' ', ' ', 'X'], # 1 # [' ', ' ', ' ', 'D', 'X', 'X', ' ', 'X', ' '], # 2 # [' ', ' ', ' ', 'D', ' ', 'X', ' ', ' ', ' '], # 3 # [' ', ' ', ' ', ' ', ' ', 'X', ' ', ' ', 'X'], # 4 # ['A', 'X', 'B', ' ', 'X', ' ', ' ', 'X', 'X'] # 5 # ] ``` ``` # ' ' represents an open road that you can travel over in any direction (up, down, left, or right). # 'X' represents an blocked road that you cannot travel through. # 'D' represents a DashMart. # # list of pairs [row, col] # locations = [ # [200, 200], (unreachable) # [1, 4], # [0, 3], # [5, 8], # [1, 8], # [5, 5] # ] # answer = [-1, 2, 0, -1, 6, 9] # Provided: # - city: char[][] # - locations: int[][2] # Return: # - answer: int[] ``` --- BFS from DashMarts to locations to minimize traversals. record distance. basically follow 01 Matrix solution and you'll be in good shape! https://leetcode.com/problems/01-matrix/
Role: L4 Software Engineer
Location: NYC
Date: September 2022
Outcome: Reject
Experience:
``` # A DashMart is a warehouse run by DoorDash that houses items found in convenience stores, grocery stores, and restaurants. We have a city with open roads, blocked-off roads, and DashMarts. # City planners want you to identify how far a location is from its closest DashMart. # You can only travel over open roads (up, down, left, right). # Locations are given in [row, col] format. # [ # # 0 1 2 3 4 5 6 7 8 # ['X', ' ', ' ', 'D', ' ', ' ', 'X', ' ', 'X'], # 0 # ['X', ' ', 'X', 'X', ' ', ' ', ' ', ' ', 'X'], # 1 # [' ', ' ', ' ', 'D', 'X', 'X', ' ', 'X', ' '], # 2 # [' ', ' ', ' ', 'D', ' ', 'X', ' ', ' ', ' '], # 3 # [' ', ' ', ' ', ' ', ' ', 'X', ' ', ' ', 'X'], # 4 # ['A', 'X', 'B', ' ', 'X', ' ', ' ', 'X', 'X'] # 5 # ] ``` ``` # ' ' represents an open road that you can travel over in any direction (up, down, left, or right). # 'X' represents an blocked road that you cannot travel through. # 'D' represents a DashMart. # # list of pairs [row, col] # locations = [ # [200, 200], (unreachable) # [1, 4], # [0, 3], # [5, 8], # [1, 8], # [5, 5] # ] # answer = [-1, 2, 0, -1, 6, 9] # Provided: # - city: char[][] # - locations: int[][2] # Return: # - answer: int[] ``` --- BFS from DashMarts to locations to minimize traversals. record distance. basically follow 01 Matrix solution and you'll be in good shape! https://leetcode.com/problems/01-matrix/