Loading interview...
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
- senior, staff
Interview Prompt
Write a function that takes a 2D grid where 0 is empty, 1 is a fresh orange, and 2 is a rotten orange. Each minute, rotten oranges infect all adjacent fresh oranges in 4 directions. Return the minimum minutes until all oranges are rotten, or -1 if impossible.
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