Figma·Machine Learning Engineer·Technical Phone Screen
- Given a 2D grid where cells are either land or water, count the number of distinct islands, where an island is any group of land cells connected horizontally or vertically.
“I went with DFS immediately which was fine, but they pushed me on why not BFS or union-find.”