Uber interview Experience

Anonymous User
3303
Jun 01, 2025
Jun 01, 2025

I appeared in uber interview recently and was asked below quastion 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 (14)