🚀 Phases 1–5 are live — Days 1–17 cover the foundations and the algorithmic patterns. See the roadmap →
Day 15 - Greedy AlgorithmsPractice QuestionsOverview

Greedy Practice Questions

Eight interview classics covering every greedy shape you’re likely to see: sort-and-pick, two pointers on sorted input, prefix tracking, interval merging, and bounded simulation. Each one is the unified greedy template with a different sort key or scan rule.

Before reading the solution, ask:

  • What’s the greedy strategy? (Often: a sort criterion + a per-item rule.)
  • Can I sketch an exchange-argument proof?
  • Can I construct a counter-example? If yes, the greedy is wrong — switch to DP.

Three questions, one template, eight problems.

Easy

ProblemPatternStatus
Assign CookiesSort both + two pointersAvailable
Lemonade ChangeBounded simulation with greedy billsAvailable
Best Time to Buy and Sell Stock IISum positive deltasAvailable

Medium

ProblemPatternStatus
Jump GameMax-reach prefix scanAvailable
Jump Game IIBFS-flavored greedy intervalsAvailable
Gas StationReset on negative running tankAvailable
Non-overlapping IntervalsSort by end + count keepersAvailable
Partition LabelsLast-occurrence prefix scanAvailable

More Practice (Coming Soon)

ProblemPatternStatus
Minimum Number of Arrows to Burst BalloonsSort by end + sweepComing Soon
Task SchedulerMax-heap by frequencyAlready on Day 7
Reorganize StringMax-heap by frequencyAlready on Day 7
Queue Reconstruction by HeightSort then insertComing Soon
CandyTwo-pass left-right scanComing Soon
Boats to Save PeopleSort + two pointersComing Soon
Minimum Number of Refueling StopsGreedy with max-heap (hybrid)Coming Soon
IPO / Maximum CapitalTwo-heap greedyComing Soon
Furthest Building You Can ReachMin-heap of ladder costsComing Soon
Wiggle SubsequenceSign-change scanComing Soon