MEDIUMasked at 1 company

Maximum Number of Potholes That Can Be Fixed

A medium-tier problem at 53% community acceptance, tagged with String, Greedy, Sorting. Reported in interviews at Geico and 0 others.

Founder's read

You're looking at a medium-difficulty greedy problem that Geico asks. The acceptance rate sits at 53%, which means half the candidates either nail it or walk out confused. The trap is thinking this is a dynamic programming problem when it's actually about making locally optimal choices that compound. If you hit this during your assessment and freeze on the greedy strategy, StealthCoder solves it invisibly in seconds with a working solution. The problem forces you to decide: which potholes do you fix first to maximize your count, and what's the constraint that makes the difference.

Companies asking
1
Difficulty
MEDIUM
Acceptance
53%

Companies that ask "Maximum Number of Potholes That Can Be Fixed"

If this hits your live OA

Maximum Number of Potholes That Can Be Fixed 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. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop.

Get StealthCoder
What this means

The core pattern is greedy selection with an interval or resource-based constraint. Most candidates default to trying every subset or building a DP table, both of which fail for large inputs. The actual trick: sort by some criterion (deadline, position, or resource cost depending on the exact problem statement), then greedily pick the next valid fix that doesn't conflict with your previous choices. The moment it clicks is when you realize you don't need to backtrack or reconsider earlier decisions. Common failure: trying to be too clever with memoization instead of just iterating once with a smart ordering. String manipulation comes in during parsing the road state, and Sorting is your primary tool. This is the kind of problem where candidates who drill greedy patterns see it in 10 minutes, and everyone else burns 25 minutes on a dead-end approach. If you're stuck mid-interview, StealthCoder is your safety net.

Pattern tags

The honest play

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

Maximum Number of Potholes That Can Be Fixed 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. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Maximum Number of Potholes That Can Be Fixed interview FAQ

Is this really a Geico problem or just reported once?+

It's in their reported ask pool. Geico's interview volume isn't as high as Meta or Google, so you won't see massive frequency data. But it's on their radar, which means it could show up in your OA. Treat it as real preparation.

Why is the acceptance rate only 53% if it's just a greedy sort-and-pick?+

Because candidates overthink it. Half the people try DP, half try brute force backtracking. The ones who recognize the greedy pattern early move fast. The trick isn't obvious until you've seen a few interval or scheduling problems.

What's the difference between this and a classic interval scheduling problem?+

The mechanics are similar: sort by some criterion, iterate once, greedily select non-conflicting items. The difference is usually in the constraint definition. Potholes might have a fixed repair time or cost limit, whereas intervals just overlap. The algorithm shape is the same.

Do I need to know advanced string tricks for this?+

No. String is listed because you're parsing the road state (probably a string representation). Basic iteration and maybe a counter or index tracker is enough. The heavy lifting is the greedy logic, not string manipulation.

How do I know which greedy choice is correct during the interview?+

Try the simplest criterion first: sort by the most constrained resource (deadline, cost, or position). Then prove it works on small examples. If it fails, pivot. Greedy problems live or die on whether your choice respects the constraint. Walk through 2-3 test cases by hand before coding.

Want the actual problem statement? View "Maximum Number of Potholes That Can Be Fixed" 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.