Quick Overview

Count islands in a binary matrix using four-directional DFS or BFS without mutating the input. Compare traversal memory behavior and handle empty grids, isolated cells, diagonal contact, and long components that make recursive search unsafe.

Count Islands in a Binary Grid

Company: Visa

Role: Software Engineer I

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Online Assessment

Overview: Count islands in a binary matrix using four-directional DFS or BFS without mutating the input. Compare traversal memory behavior and handle empty grids, isolated cells, diagonal contact, and long components that make recursive search unsafe.

Read the full Visa Software Engineer I interview experience this question came from

Loading…