Simulate Threshold Infection Efficiently

Read the full interview experience this question came from →

Quick Overview

Compute infection times on a grid where healthy cells change in synchronous rounds after reaching an infected-neighbor threshold. Use incremental neighbor counts and a round-aware queue to avoid repeatedly scanning the entire grid, including threshold-zero and never-infected cases.

Simulate Threshold Infection Efficiently

Company: Anthropic

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Onsite

Overview: Compute infection times on a grid where healthy cells change in synchronous rounds after reaching an infected-neighbor threshold. Use incremental neighbor counts and a round-aware queue to avoid repeatedly scanning the entire grid, including threshold-zero and never-infected cases.

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

|Home/Coding & Algorithms/Anthropic
Anthropic logo
Anthropic
Jul 8, 2026
hardSoftware EngineerOnsiteCoding & Algorithms
17
0
Loading...

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...