Reported May 2024
Amazon

Process Execution

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 Process Execution OA question (May 2024) is a systems design problem disguised as a coding task. You're likely managing concurrent processes, handling dependencies, or simulating execution order under constraints. The catch is that it rewards clean state management and edge case handling over raw algorithmic complexity. If you blank on the exact execution model during the OA, StealthCoder can read the problem constraints and surface the pattern in real time, so you don't lose points to panic.

Pattern and pitfall

Process execution questions typically hinge on topological sorting, state machines, or simulation. The problem probably gives you a set of processes with dependencies (process A must finish before B starts) and asks you to output the correct execution order or detect deadlocks. Common pitfall: candidates skip the dependency graph step and try to brute-force the order. The real win is building an adjacency list, tracking in-degrees, and using BFS (Kahn's algorithm) or DFS to resolve the order. Edge cases kill here: circular dependencies, empty input, single process. During the live OA, if the simulation logic gets tangled, StealthCoder ensures you have a working skeleton to lean on.

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 Process Execution 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 course schedule. 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.

Process Execution FAQ

Is this a topological sort problem?+

Likely yes. If the problem describes processes with prerequisites or dependencies, you're sorting a directed acyclic graph (DAG). Use Kahn's algorithm (BFS with in-degree) or DFS. Both work; Kahn's is clearer for detecting cycles.

What's the most common gotcha?+

Forgetting to check for circular dependencies. A process that depends on itself, or A depends on B and B depends on A, breaks everything. Handle that case explicitly before you start ordering.

How do I detect a deadlock or circular dependency?+

If all remaining processes have unmet dependencies and the dependency graph isn't empty, you have a cycle. In Kahn's algorithm, if the final order doesn't include all processes, there's a cycle. Track it and return an error or empty list as the problem specifies.

What if processes have no dependencies?+

They can execute in any order. The problem might ask for lexicographic order or any valid order. Read the constraint. If it's flexible, any order is correct. If lexicographic, sort the independent processes by name or ID.

How do I prepare in 24 hours if I'm rusty on graphs?+

Understand in-degree/out-degree and the two-step Kahn's algorithm: count in-degrees, enqueue processes with in-degree 0, process each and decrement neighbors' in-degrees. That's 90% of the solution. Write it out on paper once.

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