Find Servers That Handled Most Number of Requests
A hard-tier problem at 44% community acceptance, tagged with Array, Greedy, Heap (Priority Queue). Reported in interviews at Wish and 5 others.
You get a list of requests with arrival and completion times, and you need to find which servers handled the most requests at any given moment. Wish, Citadel, Visa, Capital One, Cisco, and Apple have all asked this. It's a hard problem with a 44% acceptance rate, which means most candidates either miss the greedy insight or build a solution that times out. The trap is simulating the timeline naively. If this problem hits your live assessment and you blank on the ordering strategy, StealthCoder surfaces a working solution in seconds, invisible to the proctor.
Companies that ask "Find Servers That Handled Most Number of Requests"
Find Servers That Handled Most Number of Requests is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.
Get StealthCoderThe core trick is tracking server availability as events, not simulating every time unit. You sort requests by arrival, process them greedily by assigning each to the server that will be free earliest, and use a heap or ordered set to find the minimum available time efficiently. The greedy choice works because assigning to the server finishing soonest minimizes future conflicts. The gotcha: tie-breaking matters. When multiple servers are free at the same time, you pick the one with the smallest ID. Most candidates either forget to sort, use a naive O(n^2) simulation, or mishandle the tie-breaking rule. Array iteration combined with Heap (Priority Queue) logic is the standard path. If you see requests as independent events rather than a timeline to simulate, the pattern clicks. StealthCoder is the hedge if the greedy insight doesn't land during the assessment.
Pattern tags
You know the problem.
Make sure you actually pass it.
Find Servers That Handled Most Number of Requests recycles across companies for a reason. It's hard-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Find Servers That Handled Most Number of Requests interview FAQ
Is this really a hard problem, or does it just look hard?+
It looks harder than it is once you see the pattern. The 44% acceptance rate reflects candidates who simulate naively or forget the heap optimization. The actual algorithmic idea (greedy assignment to the earliest-free server) is straightforward. Execution and tie-breaking are where time gets lost.
Do I actually need a Heap, or can I use an array?+
A heap (priority queue) is the efficient choice. You could use an array and sort it repeatedly, but that's slower. For each request, the heap lets you pop the server free earliest in O(log n) time. Without it, you're doing O(n) scans per request, which will time out on large inputs.
What's the trick with server IDs and tie-breaking?+
When two servers are free at the same time, pick the one with the smaller ID. This rule is easy to miss and causes wrong answers. Make sure your heap comparator (or ordered set) uses server ID as a secondary sort key after availability time.
How does this relate to Ordered Set? Is that required?+
Ordered Set is an alternative to Heap if your language supports it well. Python's heapq is simpler, but Java and C++ often use TreeSet or multiset for cleaner tie-breaking logic. Either path works. The problem tests the same greedy insight.
Do Wish, Citadel, and Apple really ask this, or is that fluff?+
Yes. This problem appears in reports from all six named companies. It's real. The 44% acceptance rate suggests it's still a screening filter for strong engineering. It's not the rarest hard problem you'll see, but it's not a gimme either.
Want the actual problem statement? View "Find Servers That Handled Most Number of Requests" on LeetCode →