Greedy interview questions
242 greedy problems tagged across recent interview reports. Drilled most heavily by flipkart, de shaw, and paypal.
Greedy is the pattern of making locally optimal choices at each step and hoping they lead to a global optimum. With 242 problems tagged greedy across interview platforms, it's a staple for Flipkart, DE Shaw, PayPal, and Amazon. The catch: greedy solutions are fast and elegant when they work, but recognizing when greedy actually solves the problem, versus when it fails, is the real skill. StealthCoder becomes your safety net when a greedy variant lands in your live OA and you need the right proof in seconds.
Most-asked greedy problems
Showing top 50 of 242 greedy problems by # companies asking.
You can't drill every greedy variant before the assessment. StealthCoder runs invisibly during screen share and solves whichever variant they throw at you. No browser extension. No detection signature. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround.
Get StealthCoderGreedy problems typically involve optimization: maximize profit, minimize cost, assign resources efficiently. You'll spot them by the phrase 'best' or 'minimum,' and by the absence of complex state dependencies. Common subtypes include interval scheduling (merge, activity selection), exchange arguments (stock trading), and priority-based assignment (assign-cookies, boats-to-save-people). The trap is assuming greedy works without verifying the exchange property, swapping two choices never makes the solution worse. Start with simpler interval and assignment greedy, then move to hard variants like broken-calculator or break-a-palindrome. Most candidates drill greedy last because it feels obvious; that gap is where StealthCoder protects you when a medium or hard greedy problem surfaces mid-assessment.
Companies that hire most on greedy
242 greedy problems.
You won't drill them all. Pass anyway.
Greedy is one of the patterns interviews actually filter on. Memorizing every variant in a week is a fantasy. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds, no matter which greedy flavor lands in your live OA. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Greedy interview FAQ
How many greedy problems should I drill before my OA?+
There are 242 tagged greedy problems. Aim for 30-40 core ones: 10-15 easy (assign-cookies, bag-of-tokens), 15-20 medium (best-time-to-buy-and-sell-stock-ii, boats-to-save-people), 5-10 hard (broken-calculator, break-a-palindrome). Depth beats breadth; understand the proof for each.
Which companies drill greedy hardest?+
Flipkart, DE Shaw, and PayPal each have 40+ greedy problems in their assessments. Microsoft, Salesforce, and JPMorgan also weight it heavily. If you're interviewing at any top-10 tech company, greedy is non-negotiable.
How do I know a problem is greedy and not dynamic programming?+
Greedy problems have no overlapping subproblems and no need to revisit choices. If you can prove a single sorted order or selection rule always works without backtracking, it's greedy. DP requires memoization; greedy doesn't. Test your rule on small counterexamples first.
What's the most common greedy mistake?+
Assuming greedy works without proving the exchange property. For example, in interval scheduling, sorting by end time works; sorting by start time doesn't. Always ask: if I swap two choices, does my solution stay optimal. Most greedy failures come from skipping this step.
Should I learn greedy before or after backtracking?+
Learn greedy first. It's simpler and builds pattern recognition for optimization. Backtracking (brute force with pruning) is a fallback when greedy fails. Mastering greedy proof also helps you spot when a problem isn't greedy at all and needs DP or brute force.