Server Selections
Reported by candidates from Amazon's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Amazon's Server Selections problem hit the May 2025 assessments, and candidates are blanking on the approach. You've got a set of servers and you need to pick a subset that meets some constraint. The trick isn't obvious from the name alone. This is exactly the kind of problem where you either see the pattern in 90 seconds or you're stuck for 10 minutes. StealthCoder reads the exact problem statement from your screen and surfaces the solution in real time, so if the constraint isn't clicking, you've got a safety net.
Pattern and pitfall
Without the exact problem text, the most common 'server selection' flavor is a greedy or optimization problem. Often it's about choosing servers that maximize some metric (throughput, cost efficiency, availability) subject to a budget or capacity limit. The pitfall is trying to brute-force all subsets. The pattern usually hinges on sorting by a key ratio (cost per unit performance, for example) and then greedily picking in order. Sometimes it's a two-pointer or sliding window problem if you're picking consecutive servers from a list. The real trick is identifying what makes one server 'better' than another given the constraint. During the live OA, if you misread the constraint even slightly, you'll code the wrong greedy order. That's where StealthCoder steps in, confirming the exact problem structure before you commit.
If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.
You can drill Server Selections cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Amazon's OA.
Amazon reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Server Selections FAQ
Is this a brute-force subset problem or a greedy one?+
Almost certainly greedy. Amazon loves constraint-based selection problems. You're not trying all 2^n subsets. Sort by the right metric, pick in order, stop when you hit a limit. The hard part is figuring out the metric from the problem statement.
What's the most common constraint in Amazon server problems?+
Budget or cost cap. You pick servers up to a maximum total cost and want to maximize performance or availability. The greedy move is to sort by cost-to-benefit ratio, not raw cost.
Should I iterate through servers in the order given or sort first?+
Sort first, almost always. The problem likely gives you an unordered list. Sorting by the relevant metric (cost, latency, performance, region) is step one. Then iterate once and pick greedily.
How do I know which metric to sort by if the problem isn't crystal clear?+
Re-read the goal and constraint separately. If goal is 'maximize X' and constraint is 'budget Y', sort by X divided by Y, highest first. If it's 'minimize latency under capacity', sort by latency. Reverse the order if needed.
Is there a trick with ties or duplicate server values?+
Possibly. If two servers have the same cost or performance, the problem might specify a tiebreaker (alphabetical ID, lower index first). Read carefully. When in doubt during the OA, pick the one that comes first in the input list.