Search
⌘K
Leetcode 427. Construct Quad Tree
Given an n×n binary grid (n a power of two), recursively build a quadtree by subdividing the grid into four equal quadrants until each region is uniform, creating a leaf node with val equal to the region's bit or an internal node with four children otherwise. The task is essentially a divide-and-conquer check for uniform subgrids and construction of the corresponding quadtree structure.
Asked at:
Uber
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early April, 2026
Uber
Senior
Late February, 2025
Uber
Mid-level
Hello Interview Premium
Your account is free and you can post anonymously if you choose.