Graph Traversal: BFS & DFS (Number of Islands) is one of the highest-frequency building blocks in coding interviews—most famously benchmarked via "Number of Islands (LeetCode 200)". Traverse connected components in a 2D matrix or graph. BFS uses a queue to expand layer-by-layer; DFS uses recursion to drill down to boundaries and mark cells visited in-place.
From an asymptotic perspective, this pattern achieves O(M × N) time complexity and O(M × N) auxiliary space complexity. A staple of FAANG interviews. Modern engineers explain how BFS calculates shortest paths in unweighted networks and how flood-fill algorithms operate in image processing.
In production engineering, this exact technique powers real infrastructure: Image processing flood-fill (paint bucket), garbage collection reachability (mark-and-sweep), and cloud VPC cluster isolation analysis. Stepping through the live state trace and comparing both the JavaScript and Python 3 implementations above builds intuition for pointer bounds, loop termination conditions, and edge cases.