Reported interview periodNov 2025–Sep 2026
Infection Spread on a Grid
A grid contains healthy cells (0) and infected cells (1). Each day, infection spreads simultaneously from infected cells to their four orthogonal healthy neighbors. Return the number of days until every suscept…
Practice focusRequirements - All initially infected cells spread at the same time. - Return 0 when no healthy cell exists initially. - Do not allow newly infected cells to spread again during the same day. - Handle empty grids and validate rectangular input. - Target O(rows cols) time and space proportional to the active frontier. In the second stage, cells marked 2 are immune: they never change and block propagation. Follow-ups 1. Add recovery after a configurable number of days. 2. Require at least q infected neighbors before a cell changes. 3.…