Your question is Breadth-First Search Coding. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
ACME's deployment planner represents service dependencies as a directed graph. Given an adjacency-list graph and a starting service, return the services reachable from that start in breadth-first order.
Visit each service at most once. When multiple services are available at the same depth, process them in the order they appear in the adjacency list. The graph may contain cycles, and services that cannot be reached from start must not appear in the result.
Implement bfs_traversal(graph, start), where graph is a dictionary mapping strings to lists of neighboring service names, and start is a string. Return a list of strings containing the breadth-first traversal. Every service referenced as a neighbor is present as a graph key.
def bfs_traversal(graph, start):