Advanced Greedy Problems for Coding Interviews
17 advanced Greedy problems from real coding interviews, each with test cases you can run online. By difficulty they split into 0 basic, 0 intermediate and 17 advanced. The companies that ask them most often are Amazon, Google, Salesforce, Mathworks.
Solve a few problems of each level, name the pattern after each one and revisit the ones that needed a hint a week later. Practise stating the time and space complexity and the edge cases before you code.
Coding problems
- Minimum Number of Taps (Advanced)
- Minimum Number of Reflections (Advanced)
- Weighted Interval Scheduling Reconstruction (Advanced)
- Time Series Gap Detection (Advanced)
- Minimum Difficulty of a Job Schedule (Advanced)
- Course Schedule III (Advanced)
- Minimum Interval to Include Each Query (Advanced)
- Longest Well-Performing Interval (Advanced)
- Minimum Flips to Make Binary String Alternating With Rotations (Advanced)
- Minimum Cuts to Split Rectangle Into Squares (Advanced)
- Lights Out Minimum Presses (Advanced)
- Minimum Adjacent Swaps to Make Anagram Equal (Advanced)
- Minimum Trips to Carry All Items (Advanced)
- Adjacent Swaps to Gather All Ones (Advanced)
- Smallest Denominator Fraction in Interval (Advanced)
- Minimum Darts to Finish (Advanced)
- Intervals Inside Another Interval (Advanced)
Related
Frequently asked questions
How do I get good at greedy problems?
Practise by level, name the pattern after you solve each problem and review the ones you needed hints for. The list is ordered so you can start with the basic ones.
Can I run greedy problems online here?
Yes. Each problem opens in an editor that runs your code against test cases in Java, Python, C++, Go, JavaScript and more.