Count Same-Color Squares in an Unbounded Grid
Asked at Waymo · Coding Questions · Difficulty: Medium · Last asked May 6, 2026
Phone screen on a 2-D grid whose cells carry color labels A / B / C / D. Count the number of axis-aligned squares formed by connected same-color cells. Grid has no a-priori size bound — the data structure must handle sparse cell sets.
Loading the problem…
More Waymo interview questions
- ML System Design: Choose Passenger Drop-off Location
- L5+ Behavioral: Policy vs Efficiency Trade-offs & Leadership
- Fix a Buggy Matrix Class
- Project Deep-Dive + ML Fundamentals Discussion
- ML System Design: Behavior Prediction from Sensor + Camera Data
- ML System Design: Inference Serving with Back-of-Envelope Capacity Planning