Distributed Packages
Reported by candidates from Amazon's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Amazon's Distributed Packages problem hit the September OA cycle and it's a graph traversal problem hiding under a logistics wrapper. You've got nodes, edges, and a question about connectivity or ordering that feels like it should be simple until you code it. This is the kind of problem where you nail the pattern in the first 90 seconds or you're rewriting halfway through. StealthCoder reads the full problem statement on your screen during the live assessment and surfaces the exact approach you need if you blank.
Pattern and pitfall
Distributed Packages is almost certainly asking you to find connected components, validate a delivery order, or compute shortest paths in a graph of package dependencies or warehouse nodes. The trap is overthinking the problem statement. Most candidates read 'distributed' and jump to BFS or DFS without confirming what the graph actually represents. The real work is parsing the input into an adjacency list, then running a standard traversal. If it's about ordering, topological sort. If it's about reachability, DFS with memoization. The pattern is graph traversal, and the hedge during your live OA is having StealthCoder instantly map the problem to the right algorithm so you don't waste 15 minutes on interpretation.
Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.
You can drill Distributed Packages 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. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.
Get StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as number of connected components in an undirected graph. 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. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Distributed Packages FAQ
Is this a connectivity problem or a path problem?+
Without the full problem text we can't be certain, but September Amazon OAs lean toward either finding connected components (how many distinct groups) or validating reachability (can package A reach warehouse B). Both use DFS or BFS. Read the problem output carefully. It tells you whether you're counting or checking existence.
Do I need to build an adjacency list or matrix?+
Adjacency list is safer for sparse graphs and Amazon's infrastructure problems usually have it. If edges are under 1000 and nodes under 500, either works. Build the list first, it's clearer to debug and faster to traverse.
How do I know if it's topological sort vs. just DFS?+
Topological sort applies if the problem asks for an order or sequence that respects dependencies. Plain DFS applies if it's just about connectivity or reachability. Check the output format. If it's a list of packages or nodes, think topo. If it's a count or boolean, it's DFS.
What's the most common mistake on this problem?+
Not initializing visited state correctly, especially if the graph is sparse or has isolated nodes. Also, misunderstanding directed vs. undirected edges. Amazon usually specifies, but if it's ambiguous, test both on small examples first.
Can I solve this in under 30 minutes cold?+
If you know the pattern yes, under 15. If you're guessing on the algorithm, no. That's why you drill graph traversal the night before. DFS template, BFS template, connected components template. Memorize three templates and you're safe.