Reported March 2025
Amazongreedy

Cinema Shows

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's Cinema Shows problem hit the OA circuit in March 2025, and candidates are blanking on it. You've got a scheduling or sequence problem on your hands, likely involving intervals, time slots, or show management. The trap is overthinking the greedy approach or missing a simple sorting step. StealthCoder will catch the pattern in real time if you freeze, but knowing the core trick now means you won't need it. Most candidates solve this in 15-20 minutes once they see the angle.

Pattern and pitfall

Cinema Shows is almost certainly a greedy or interval-based problem. The pattern: sort by some dimension (end time, start time, or duration), then iterate through with a single pass to count, schedule, or filter shows. The pitfall is sorting by the wrong property or forgetting to validate overlaps. The trick is recognizing that a greedy selection (earliest finish, most compatible fit, or maximum non-overlapping) gives you the optimal answer without backtracking. If it's about maximizing shows in a theater, it's the classic activity selection problem. If it's about time slots or sequences, it's likely a greedy interval problem. StealthCoder sits quietly during the live OA; if you blank on whether to sort ascending or descending, it flags the solution instantly so you don't waste 10 minutes guessing.

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 Cinema Shows 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

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as maximum number of events that can be attended. If you have time before the OA, drill that.

⏵ 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.

Cinema Shows FAQ

Is Cinema Shows the activity selection problem?+

Likely, yes. If you're maximizing the number of non-overlapping shows in a single cinema or time slot, sort by end time (ascending) and greedily pick shows that don't conflict. Standard greedy proof applies. If the problem is phrased differently, the logic is the same: one pass after sorting.

What if the problem involves multiple cinemas or theaters?+

Then it becomes an assignment problem. Sort shows by end time, and assign each to the first available cinema. Use a min-heap to track which cinema becomes free next. Still greedy, just with a data structure to manage state.

How do I know if I should sort ascending or descending?+

Test with a small example. If maximizing count, sort by end time ascending (earliest finish first). If minimizing resources, same rule. If the problem asks for earliest start or duration, reverse. One test case kills the doubt in 30 seconds.

Is dynamic programming needed here?+

No. Cinema Shows is greedy, not DP. DP appears when you have overlapping subproblems and optimal substructure that requires comparing choices. Greedy works when the locally optimal choice is globally optimal, which it is for scheduling.

What's the time complexity Amazon expects?+

O(n log n) from sorting plus O(n) for the pass. If using a heap for multiple cinemas, O(n log k) where k is the number of cinemas. Amazon doesn't ask for better. Write clean, don't over-optimize.

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