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

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write your python solution with real code execution
  4. Get instant feedback and a hire/no-hire decision