Flood Fill
Asked at Apple · Coding & Leetcode-style Questions · Difficulty: Easy · Last asked Apr 20, 2026
You are given an `m x n` integer grid `image` where `image[r][c]` is the pixel color at that position, and three integers `sr`, `sc`, and `color`. Starting from pixel `(sr, sc)`, replace the color of all pixels connected 4-directionally (up, down, left, right) that share the original color with `color`.
Loading the problem…
More Apple interview questions
- LLM conceptual questions
- Implement a Two-Hidden-Layer MLP with Backpropagation in NumPy
- Compare PPO, DPO, and GRPO
- Implement a Vision Transformer (ViT) from Scratch
- Sample from a Gaussian Distribution Using Only Uniform Sampling
- ML Fundamentals and Model Debugging Rapid-Fire