I finished the problem and ran a few test cases I wrote myself. A week later I got a "moving forward with other candidates" rejection.
I had AI polish up the problem statement a bit:
Package Build Order (dependency build order)
Problem description (abstract version):
The interviewer gave me an interface:
get_dependencies(package)
— it returns the direct dependencies of a given package.
Requirements: given a target package, output a valid build order such that all of its dependencies are built before it.
Constraints:
- The dependency relationship is a directed graph (A depends on B)
- The graph isn't given all at once — it's queried dynamically through the API
- You only need to consider the dependency subgraph relevant to the target
- If there's a cycle, return empty / raise an error
- The solution doesn't need to be unique
What this problem really is: this is a variant of a classic problem — topological sort on an implicit / lazily-loaded graph.
Added (2026-05-04 03:54 +08:00): the recruiter said the reason I didn't pass was that I wasn't proactive enough — I didn't think about what happens if the system goes down, and I didn't call out edge cases and failure cases.
Discussion
Loading comments…