MEDIUMasked at 2 companies

Minimum Time to Complete Trips

A medium-tier problem at 39% community acceptance, tagged with Array, Binary Search. Reported in interviews at Amadeus and 1 others.

Founder's read

Minimum Time to Complete Trips is a medium-difficulty problem that asks you to find the shortest time needed to complete a set number of trips using multiple vehicles with different speeds. It's been asked at Amadeus and Meesho. The trap is obvious: sort by speed or greedily assign trips. The real solution uses binary search on the answer space, not on the input data. Only about 39% of candidates pass it first try, which means most people are solving it the slow way or missing the search space entirely. If this problem hits your live OA and you blank on the binary search angle, StealthCoder solves it in seconds, invisible to the proctor.

Companies asking
2
Difficulty
MEDIUM
Acceptance
39%

Companies that ask "Minimum Time to Complete Trips"

If this hits your live OA

Minimum Time to Complete Trips is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made for the engineer who has done the work but might still blank with a webcam pointed at him.

Get StealthCoder
What this means

The problem wants you to answer: what's the minimum time T such that all vehicles working in parallel can complete at least the target number of trips. This is a classic binary search on the answer pattern. You don't search the trips or times directly. Instead, you search a range from 1 to some upper bound (like max_time * total_trips), and for each candidate time, check if the total trips possible in that time meets your goal. The check function counts how many trips each vehicle can do in time T and sums them. Most candidates miss this framing and try greedy or priority-queue approaches, which fail. The topics are Array and Binary Search. Your array holds trip times for each vehicle. Binary search is the only efficient way to find the answer time. StealthCoder knows this pattern and can surface the working solution even if you've never seen this exact problem.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Minimum Time to Complete Trips recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made for the engineer who has done the work but might still blank with a webcam pointed at him. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Minimum Time to Complete Trips interview FAQ

Is Minimum Time to Complete Trips a classic Google/Meta problem?+

It's been asked at Amadeus and Meesho. Not in the heavy rotation at mega-cap tech yet. But the binary search on answer pattern is core to many timed-resource problems, so the skill transfers. If you see a 'minimum time' or 'minimum cost' phrasing, think binary search on the answer space first.

Why doesn't a greedy or sorting approach work here?+

Greedy fails because vehicle speeds aren't independent. If you assign trips sequentially, you're simulating time step by step, which is O(answer * n) or worse. Binary search cuts that down to O(log(answer) * n). The problem requires parallel execution, which makes greedy assignment order irrelevant. Binary search on time encodes the parallelism.

What's the upper bound for the binary search range?+

A safe upper bound is the maximum trip time multiplied by the target number of trips. If one vehicle takes 10 time units per trip and you need 1000 trips, the worst case is 10000. You can also use a tighter bound based on the total trips and slowest vehicle, but a loose upper bound is fine. Binary search converges fast either way.

How do you check if a given time T is feasible?+

For each vehicle with trip time t, calculate how many trips it can complete in time T by dividing T by t (integer division). Sum across all vehicles. If the sum is at least the target, T is feasible. Move the binary search left. Otherwise, move right. This check is O(n) per call.

Is this problem harder than typical binary search drills?+

Not harder in execution, harder in recognition. The acceptance rate is 39%, mostly because candidates don't immediately see 'binary search on the answer' as the frame. Once you recognize the pattern, the code is straightforward. If you've practiced binary search on answer space before, this is medium difficulty. If not, it feels like hard.

Want the actual problem statement? View "Minimum Time to Complete Trips" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.