Greedy Interview Questions [2026-2027]

295+ real questions from verified interview reports across 12 companies.

Sourced from 1Point3Acres, Blind, Glassdoor, Reddit, and more. Translated and cleaned.

295
Questions
12
Companies
12
Top Askers

Top Companies Asking Greedy Questions

Sample Greedy Questions

\tGot below question in Amazon OA: \t \tAmazon recently launched a new game Fruit Crush. In this game you are alllowed to choose two dissimilar fruits and crush them. \tEach type...

application. The goal is to have the computational power of the servers in non-decreasing order. To do 50, you can increase the computational power of each server in any contiguous segment by x. Choose...

Recieved this question for Amazon OA, although looks very similar to https://leetcode.com/problems/minimum-number-of-increments-on-subarrays-to-form-a-target-array/description/, there is a minor difference in how the subarrays are handled. Tried a lot but could only pass...

Given an postive array, you can chose any element and multiply by -1, find maximum number of the operations you do so that cumulative sum of the array is positive Example:...

Debugging Section - 7 Ques (20 minutes) This section was very esay. You do not need to prepare for it separately. \t 2. Coding Section - 2 Ques (70 minutes) ...

I recently interviewed with **Kivi Capital** for the **Quant Researcher** role. The first round lasted around **60 minutes** and consisted of **one algorithmic problem followed by several conceptual c

This post was last edited by leehen on 2025-10-4 16:22. Requesting points!! Another round of interviews is about to begin, I want to read some interview experiences to boost my confidence. I didn't pa

**Problem Statement** Given a string `num` consisting of digits and an integer `k`, reorder the digits to form the lexicographically largest valid string. A string is considered valid if no specific d

LeetCode #2241: Design an ATM Machine. Difficulty: Medium. Topics: Array, Greedy, Design. Asked at Yandex in the last 6 months.

LeetCode #1921: Eliminate Maximum Number of Monsters. Difficulty: Medium. Topics: Array, Greedy, Sorting. Asked at Agoda in the last 6 months.

LeetCode #55: Jump Game. Difficulty: Medium. Topics: Array, Dynamic Programming, Greedy. Asked at Agoda in the last 6 months.

LeetCode #3893: Maximum Team Size with Overlapping Intervals. Difficulty: Medium. Asked at Agoda in the last 6 months.

LeetCode #122: Best Time to Buy and Sell Stock II. Difficulty: Medium. Topics: Array, Dynamic Programming, Greedy. Asked at ServiceNow in the last 6 months.

LeetCode #1328: Break a Palindrome. Difficulty: Medium. Topics: String, Greedy. Asked at Workday in the last 6 months.

LeetCode #678: Valid Parenthesis String. Difficulty: Medium. Topics: String, Dynamic Programming, Stack, Greedy. Asked at Pornhub in the last 6 months.

LeetCode #2591: Distribute Money to Maximum Children. Difficulty: Easy. Topics: Math, Greedy. Asked at Gusto in the last 6 months.

LeetCode #678: Valid Parenthesis String. Difficulty: Medium. Topics: String, Dynamic Programming, Stack, Greedy. Asked at Motive in the last 6 months.

LeetCode #122: Best Time to Buy and Sell Stock II. Difficulty: Medium. Topics: Array, Dynamic Programming, Greedy. Asked at Careem in the last 6 months.

LeetCode #45: Jump Game II. Difficulty: Medium. Topics: Array, Dynamic Programming, Greedy. Asked at Zulily in the last 6 months.

LeetCode #1488: Avoid Flood in The City. Difficulty: Medium. Topics: Array, Hash Table, Binary Search, Greedy, Heap (Priority Queue). Asked at Trend Micro in the last 6 months.

LeetCode #55: Jump Game. Difficulty: Medium. Topics: Array, Dynamic Programming, Greedy. Asked at TomTom in the last 6 months.

LeetCode #45: Jump Game II. Difficulty: Medium. Topics: Array, Dynamic Programming, Greedy. Asked at TomTom in the last 6 months.

LeetCode #134: Gas Station. Difficulty: Medium. Topics: Array, Greedy. Asked at CME Group in the last 6 months.

## Problem Simulate memory allocation and deallocation operations, tracking free and occupied blocks efficiently. ## Tags greedy, arrays, other

## Problem You have a container of width `W` and unlimited height. Blocks have varying widths `w_i` and heights `h_i`. Pack all blocks into the container in given order (left to right, then shelf by shelf). When a block does not fit on the current shelf, start a new shelf. A shelf's height equals the tallest block placed on it. Return the total container height used. ```python def container_height(blocks: list[tuple[int,int]], W: int) -> int: # blocks[i] = (width, height) ... ``` **Example:** ``` blocks = [(3,2),(4,5),(2,3),(5,1),(3,4)], W = 7 Shelf 1: (3,2),(4,5) -> width used=7, height=5 Shelf 2: (2,3),(5,1) -> width=7, height=3 Shelf 3: (3,4) -> width=3, height=4 Total height: 5+3+4 = 12 Output: 12 ``` ## Follow-ups - How would you minimize total height if you can reorder the blocks before packing? - What heuristic ordering (e.g., sort by height descending) tends to reduce wasted space? - Extend to a 2D bin-packing variant where the container has a fixed height as well -- how do you determine the minimum number of containers needed?

See All 295 Greedy Questions

Full question text, interview context, and company-specific frequency data for subscribers.

Get Access

Related Topics