Reported August 2024
Amazon

Get Active Requests Count

Reported by candidates from Amazon's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Amazon OA. Under 2s to a working solution.
Founder's read

Amazon asked this in August 2024, and it's a deceptive problem. At first glance it sounds like a basic counter. You're tracking active requests, probably over a time window or lifecycle. The trick is usually in how you define 'active' (concurrent at a point in time, or within a window?) and whether you need to handle updates or queries efficiently. If you blank on the approach, StealthCoder will spot the pattern and give you the working skeleton in seconds.

Pattern and pitfall

This problem typically boils down to either event processing with timestamps or a data structure that tracks state. If requests have start/end times, you're looking at an interval overlap problem, often solved with sorting events and a sweep line or a heap. If it's a live counter that increments/decrements, you need a concurrent-safe design. The pitfall most candidates hit is not clarifying the input format upfront: are you given a list of request objects with timestamps, or a stream of add/remove operations? StealthCoder on your second monitor will help you identify which pattern applies before you code yourself into a corner.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Get Active Requests Count 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 StealthCoder

Related leaked OAs

⏵ The honest play

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.

Get Active Requests Count FAQ

Is this about counting overlapping time intervals?+

Likely. If requests have start and end times, you sort events (start/end markers) and sweep left to right, tracking the current count. Peak active requests is the max count seen. That's the classic interval overlap trick.

Do I need to optimize for multiple queries, or one final answer?+

Ask yourself: is the input a single list of requests, or does the problem ask you to handle many 'how many active at time T' queries? If queries, a sorted list plus binary search or a segment tree. If single answer, a sweep line is enough.

What if the problem is about a live counter, not time windows?+

Then you're tracking concurrent requests via add/remove operations. A simple integer counter works, but think about thread safety if the problem hints at concurrency. Atomic operations or locks might be the real question.

How hard is this really for Amazon in August 2024?+

Medium. It's testing whether you can model the problem correctly and pick the right data structure. The sorting and sweep line pattern is not trivial but well-known. Most failures are from misreading the input format.

Can I prepare for this in 48 hours?+

Yes. Drill interval overlap, event-based sorting, and heap-based approaches. Understand merge intervals and the meeting rooms problems on LeetCode. That covers 90 percent of the space.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Amazon.

OA at Amazon?
Invisible during screen share
Get it