Tech_Interview_Prep

Greedy Algorithms

Making the locally-best choice at each step and never revisiting it — correct only when the problem has the right structural guarantee.

Q1.What is the core idea of a greedy algorithm?

Q2.For a greedy algorithm to be guaranteed correct, what property must the problem have?

Q3.In the classic "activity selection" (interval scheduling) problem, what greedy strategy maximizes the number of non-overlapping activities selected?

Q4.Why does the classic coin-change "greedy always pick the largest coin" strategy fail for some coin denominations?