Get Total Requests
Reported by candidates from Amazon's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Amazon's June 2024 OA included a problem called Get Total Requests. No verbatim statement is available yet, but the title suggests you're summing request counts across some data structure, possibly with filtering or time windows involved. This is a classic Amazon backend problem. If you blank during the live OA, StealthCoder runs invisibly on your screen and reads the problem text to guide you toward the solution in real time.
Pattern and pitfall
Request-counting problems at Amazon usually combine counting, aggregation, or hash-table lookups. The trick is often in the aggregation step: do you sum by user, by endpoint, by timestamp bucket, or by some composite key? Edge cases include handling duplicate requests, filtering by time range, or deduplicating by request ID. The pattern typically involves iterating through a list or map of requests and accumulating totals. If you freeze mid-interview, StealthCoder provides the pattern and sample pseudocode as a safety net to get you unstuck on the actual OA.
StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.
You can drill Get Total Requests 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. If you're reading this with an OA window open, you're who this was built for.
Get StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as group anagrams. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass Amazon's OA.
Amazon reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Get Total Requests FAQ
Is this a hash-table or array problem?+
Almost certainly hash-table. You're likely grouping requests by some key (user, endpoint, or ID) and summing counts. An array scan will filter and aggregate. Both patterns appear in real Amazon OAs, but the problem title suggests aggregation, not sorting.
What's the trick Amazon is looking for?+
Correctly identifying the aggregation key and handling edge cases without over-complicating. Don't assume you need a complex data structure. Most candidates overthink it. Iterate, group, sum, return. That's usually the whole solution.
How do I prepare in 48 hours?+
Memorize the pattern: read input, build a hash from the key you choose, iterate and accumulate, return the result. Practice one or two similar problems on LeetCode (Group Anagrams, Word Frequency) to feel confident. Then stop. You either know this pattern or you don't.
Is there a time complexity trap?+
Yes. O(n) or O(n log n) is expected. If your solution is O(n^2) or uses nested loops, you're off track. Hash-table insertion and lookup are O(1) on average, so stick with that approach.
Should I expect follow-ups about scaling or concurrency?+
Possibly. Be ready to discuss handling high request volume or distributed systems. But nail the core algorithm first. Follow-ups come only if your baseline solution is clean. Don't premature-optimize.