Quick Overview

A grid holds empty cells, healthy people and infected people, and each day every infected person infects the healthy people in edge-adjacent cells. The task asks for the number of days until nobody healthy remains, or -1 if someone can never be reached, and tests grid traversal, careful day counting and unreachable edge cases.

Days Until an Infection Spreads to Everyone on a Grid

Company: OpenAI

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Overview: A grid holds empty cells, healthy people and infected people, and each day every infected person infects the healthy people in edge-adjacent cells. The task asks for the number of days until nobody healthy remains, or -1 if someone can never be reached, and tests grid traversal, careful day counting and unreachable edge cases.

Read the full OpenAI Software Engineer interview experience this question came from

Days Until an Infection Spreads to Everyone on a Grid

OpenAI • Software Engineer

Loading…