Back to problems

Service Dependency Topological Order

Algorithm · Uber · Medium

Requirements You are given n services and dependency pairs (a, b). Each pair means that service a requires service b, so b must be built before a. Implement the following function: For the requested target service, return any ordering that includes the target and every service that it depends on, directly or indirectly. The returned sequence must place each dependency before the service that needs it. The initial input is guaranteed to describe an acyclic dependency graph.…

Checking your access…