I knew this was a graph traversal problem pretty fast, but I fumbled on the transitive part for longer than I'd like to admit.
Model the services and their data dependencies as a directed graph where nodes are services and edges represent data flow from producer to consumer. Then, for each deleted data path, identify the services that directly read or write that path and perform a BFS/DFS to find all transitively affected services, ensuring the output is in topological order of propagation.
Pro tip: Clarify whether the propagation should consider only direct dependencies or also indirect ones through multiple hops, and mention that you would handle cycles gracefully (e.g., by detecting and breaking them or reporting them as errors) to avoid infinite loops.
Extract each service's read and write data paths and build a directed graph where an edge from service A to service B exists if A writes data that B reads.
For each deleted data path, find all services that directly read from or write to that path; these are the starting points for propagation.
Perform a graph traversal (BFS or DFS) from the initial affected services, following edges in the direction of data flow, to collect all downstream services.
Ensure the affected services are listed in the order they are reached during traversal, which naturally reflects the propagation order (e.g., using BFS levels or topological sort).
Consider cycles, multiple deleted paths, and services that both read and write the same path; deduplicate services and verify the result against the dependency graph.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.