MEDIUMasked at 1 company

Maximum Earnings From Taxi

A medium-tier problem at 45% community acceptance, tagged with Array, Hash Table, Binary Search. Reported in interviews at Myntra and 0 others.

Founder's read

Maximum Earnings From Taxi is a medium-difficulty problem that hits the acceptance rate sweet spot: just under 45%, which means it's hard enough to differentiate candidates but not a brute-force reject. Myntra has confirmed it on their assessment. The setup looks simple: you're given taxi rides with start times, end times, and tips. Pick a subset that maximizes profit without overlaps. The trick isn't obvious at first glance, and that's where most candidates stall. If this problem lands on your live OA and the greedy approach fails, StealthCoder surfaces the optimal solution in seconds.

Companies asking
1
Difficulty
MEDIUM
Acceptance
45%

Companies that ask "Maximum Earnings From Taxi"

If this hits your live OA

Maximum Earnings From Taxi 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 by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.

Get StealthCoder
What this means

The instinct is to sort by profit and grab the highest-paying rides, but overlaps kill that fast. The real pattern lives in dynamic programming with binary search. Sort rides by end time, then for each ride decide: take it and add its profit to the best non-overlapping solution before it, or skip it. Binary search finds the latest ride that doesn't conflict. The transition is clean once you see it, but the insight that greedy fails here is where candidates get stuck. Array and sorting get you organized, hash tables handle ride lookups, binary search accelerates the DP recurrence. If you freeze on the pattern during the assessment, StealthCoder runs invisibly and hands you the code.

Pattern tags

The honest play

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

Maximum Earnings From Taxi 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 by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Maximum Earnings From Taxi interview FAQ

Is this actually asked at Myntra?+

Yes, it's confirmed in their assessment data. It's not ultra-high-frequency across the board, but Myntra specifically uses it. That alone means it deserves your attention if you're prepping for them.

What's the trick that makes this medium, not hard?+

Greedy fails. The DP+binary search pattern is standard once recognized, but the jump from 'pick high-profit rides' to 'I need to track non-overlapping subsets' isn't automatic. That's the medium hump.

How do overlap checks work efficiently?+

Sort rides by end time. Then binary search on the sorted list to find the latest ride that ends before your current ride starts. That's your recurrence boundary. Without binary search, you'd recalculate overlaps repeatedly and TLE.

Will the DP table blow up in memory?+

No. You're building a 1D DP array where dp[i] is max profit using rides 0 to i. Linear space. Sorting and binary search dominate the work, not storage.

Is this about array manipulation, or is it really a DP problem?+

It's a DP problem wearing an array costume. The topics list mentions both because sorting and binary search are implementation pieces. The core is the DP recurrence and non-overlapping interval logic.

Want the actual problem statement? View "Maximum Earnings From Taxi" 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.