Answer Exact Island-Size Existence Queries

Read the full interview experience this question came from →

Quick Overview

Preprocess a binary grid so exact island-size queries can be answered in average O(1) time. Traverse each four-connected island once, store its completed size in a set, and keep query work independent of grid dimensions.

Answer Exact Island-Size Existence Queries

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Overview: Preprocess a binary grid so exact island-size queries can be answered in average O(1) time. Traverse each four-connected island once, store its completed size in a set, and keep query work independent of grid dimensions.

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

|Home/Coding & Algorithms/Meta
Meta logo
Meta
Aug 8, 2026
mediumSoftware EngineerOnsiteCoding & Algorithms
11
0
Loading...

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...