The Infection Spread
A hard Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- hard
- Seniority
- L5
Interview Prompt
We're modeling spoilage across a produce-storage grid where each cell is empty, holds a fresh item, or holds an already-spoiled one. Every minute, spoilage spreads from each spoiled cell to the fresh items directly beside it. Return how many minutes pass before nothing fresh is left.
Summary
It starts with one, and then it spreads.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your python solution with real code execution
- Get instant feedback and a hire/no-hire decision