Loading section...
BFS with Deque for Graph Problems
Concepts: pyBFSLineage, pyDAGLevels, pySchemaImpact
BFS is the right tool when you need shortest paths in unweighted graphs or level-by-level processing. In DE interviews, the graphs are almost always dependency graphs or lineage graphs. 'Find all tables that would break if this schema change is applied' is BFS over a lineage graph. 'What is the minimum number of pipeline stages to run these tasks?' is BFS for level computation over a DAG. The algorithm is always the same. The domain framing is what makes it a DE interview problem. Shortest Path in an Unweighted Graph DAG Level Analysis: Schema Change Impact This is the DE-specific BFS problem that shows up at Snowflake and dbt Labs interviews. Given a table lineage graph (directed acyclic graph where edges mean 'downstream depends on upstream'), find all tables affected by a schema change