Top 50 Greedy Interview Questions
The most frequently asked Greedy questions across all roles and companies, ranked by real interview frequency. Updated daily.
Implement an LRU cache in O(1) average time using a hash table and doubly linked list.
Allianz
ICF
InsuletImplement a per-user sliding window rate limiter that accepts or rejects requests in O(1) amortized time.
Patreon
Cresta (CA)
ServiceTitanUse Kadane's algorithm to find the contiguous subarray with the largest sum in linear time.
Meta
Publicis Groupe
Smbc Global FoundationSign up to see every question
Create a free account to unlock this list and practice real interview questions.
Scan the array once to track the largest and second largest distinct values in O(n) time.
Sparta global
AMD Construction GroupIIBM Business ServicesMerge overlapping intervals by sorting time ranges and scanning once to build the minimal non-overlapping result.
Meta
Eversana
NavihealthImplement a token bucket rate limiter that safely validates signed requests and enforces per-key limits in O(1) average time.
Meta
Fuku
NetDocumentsUse arithmetic to find the missing number in an array containing distinct values from 0 to n.
Air France
LogicMonitorImplement K-means from scratch with centroid initialization, iterative assignment/update steps, and convergence checks.
ByteDance
Scry AI
Hugging Face