Assign people to cars based on shortest travel time from two start points.
Asked at Karat · Coding Questions · Difficulty: Medium · Last asked Jul 15, 2026
Given a list of roads, each described in the format `[Origin, Destination, Duration]`. There are two starting locations and a list that contains people and their locations. Both cars leave from their respective starting locations simultaneously, and the first car to reach someone's location will pick them up. If both cars arrive at the same time, the person can choose either car. Return who will be in each car upon arriving at the campground.
Loading the problem…
More Karat interview questions
- Treasure Rooms Reachable from Any Room in DAG
- Find String Path in Grid Moving Only Right or Down
- Calculate Department Visit Difference for Shopping Lists
- Find Valid Rooms
- Bus Schedule Management with Priority Boarding
- Find Word with Anagram Present in Given String