Uber interview Experience

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2025-06-01Added By Anonymous
Source: Link

Company: Uber
Role: unknown
Interview Stage: Phone Screen
Location: unknown
Year: unknown

Original Post Content:

I appeared in Uber interview recently and was asked below question in the first round.

There are n cars on x axis. i-th Car's initial position is denoted by location[i] and maximum speed by speed[i]. cars can travel in both directions(left and right).
At the end, all cars need to meet at the same location, what would be the minimum time required at which all cars can meet.

Test case
cars : 3
position: [1, 3, 7]
speed: [2, 1, 1]

Answer: 2
if these cars meet at 5. each car will take 2 units of time.

I solved this problem but few test cases didn't pass, so got rejected.
All the best to you guys.

Comments