We use cookies for site analytics. Accept to help us understand how the site is used. See our Privacy Policy for details.
Greedy is the shortest correct solution when it works and confidently wrong when it does not, so the interview skill is justifying it. Sorting first, then making one pass taking the best available option, solves a surprising number of scheduling and reachability problems. If you cannot argue why the local choice never forecloses a better global one, assume DP instead.
Interval scheduling, jump/reachability questions, or an optimisation with an obvious local choice.
11 problems. Each one runs in an in-browser editor against real test cases, with hints and a worked solution.
The patterns cheat sheet covers all of these in one page - what each one looks like in a problem statement, and the template that follows.