Reported interview periodJan 2026–Sep 2026
Contagion in a Grid
A rectangular grid contains empty cells (0), fresh items (1), and contaminated items (2). At each minute, every fresh item sharing an edge with a contaminated item becomes contaminated. All changes within a min…
Practice focusImplement: Return the number of minutes required for every fresh item to become contaminated. Return 0 if there are no fresh items initially, and -1 if at least one fresh item is unreachable. Diagonal neighbors do not interact. Aim for O(rows columns) time and space. Staged follow-ups 1. Return the earliest arrival time for every reachable cell from multiple sources. 2. Introduce blocked cells and targets, returning the time when all targets are reached. 3. You may remove at most one shared blocker for the entire propagation.…