BOSCH On Campus OA 2021 | Car Fleet | Greedy and Sorting

Question · Posted Jun 2026

Problem Statement There are n cars traveling towards the same destination located at position target. You are given two integer arrays: position[i] = current position of the ith car. speed[i] = speed of the ith car. A car can never pass another car ahead of it. If a faster car catches up to a slower car, it becomes part of the same fleet and travels at the slower car's speed. A car fleet is a group of one or more ...

The full answer & interview discussion are available to premium members.

Log in Create a free account