Uber Seattle | Sr SWE

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2022-04-27Added By Anonymous
Source: Link

Company: Uber

Role: Senior Software Engineer

Interview Stage: Phone Screen

Location: Seattle


Original Post Content:


Uber Technical Video Screen


Very similar to https://leetcode.com/problems/reconstruct-itinerary/ but the origin is not provided. We should find the origin, assuming there exists a valid origin and output the complete route .


Follow up - What if multiple routes are available and output the longest route possible.

[["JFK","SFO"],["ATL","CDG"],["SFO","ATL"],["CDG","MAA"],["MAA","ORD"],["ORD","DFW"],["CDG","DXB"]]


Valid routes -

JFK - SFO - ATL - CDG - MAA - ORD - DFW

JFK - SFO - ATL - CDG - DXB


Output should be JFK - SFO - ATL - CDG - MAA - ORD - DFW



Comments