InterviewDB
Question
Largest Shape: Find the Largest Connected Region of the Same Value in a 2D Grid
phone
Question Details
Round 1 - Coding Problem Given an M x N grid of integers, find the largest connected region where all cells share the same value. Connectivity is 4-directional (up, down, left, right). Return the size and value of that region. Example Approach BFS/DFS from each unvisited cell, tracking region size and value. Keep a visited set to avoid double-counting. Follow-ups How does your solution change if you also allow diagonal connectivity (8-directional)? If the grid is very large (10,000 x 10,000), ho…
Full Details
🔒
Unlock all Glean questions
Full insider details, leaked discussions, and candidate experiences.
Get full access — $100 a year, unlimited accessAbout This Question
This is a reported interview question from a glean interview during the phone round.
It covers the following topics: Phone, Graph, Coding, Onsite, Matrix .
More Glean Interview Questions
1p3a
fulltime machine learning onsite interview experience at glean sf office
1p3a
glean software engineer tech phone screen interview experience
InterviewDB
Glean SWE Phone - Array Compression
1p3a
Glean Backend Engineer Interview Experience and Rejection Discussion
1p3a
Glean Tech Phone Screen Problem: Document Processing and Node Allocation