Uber interview Experience

uber logo
uber
June 1, 20251 reads

Summary

I appeared in an Uber interview recently and was asked a coding question in the first round, which I solved but failed some test cases, leading to rejection.

Full Experience

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.

Interview Questions (1)

Q1
Minimum Time for All Cars to Meet
Data Structures & Algorithms

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.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!