Your question is Service Dependency Graph Traversal. 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.
Given a directed graph of service dependencies represented as a dictionary graph, where each key is a service name and its value is a list of dependent services, implement a traversal starting from start_service. Return the services visited in traversal order using either breadth-first search (BFS) or depth-first search (DFS), based on a method parameter equal to "bfs" or "dfs". If a service appears multiple times through different paths, visit it only once.
def traverse_dependencies(graph, start_service, method):