PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Uber

Build Quadtree and Find Grid Words

Last updated: Apr 22, 2026

Quick Overview

This question evaluates divide-and-conquer tree construction and recursive spatial data structures for the quadtree task, and grid-based search and backtracking for the word-finding task, along with expected time and space complexity analysis for both.

  • hard
  • Uber
  • Coding & Algorithms
  • Software Engineer

Build Quadtree and Find Grid Words

Company: Uber

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Onsite

This interview included two algorithm problems. 1. Quad-partition tree: Given an `n x n` binary matrix where `n` is a power of 2, recursively build a tree representation of the matrix. Each node represents a square region. If all cells in the region have the same value, create a leaf node storing that value. Otherwise, create an internal node with four children in this order: top-left, top-right, bottom-left, bottom-right. Return the root node. 2. Find dictionary words in a character board: Given an `m x n` grid of lowercase letters and a list of candidate words, return all words that can be formed by moving horizontally or vertically between adjacent cells. A cell may be used at most once when forming a single word. Return each matching word at most once, in any order. Discuss the expected time and space complexity for both problems.

Quick Answer: This question evaluates divide-and-conquer tree construction and recursive spatial data structures for the quadtree task, and grid-based search and backtracking for the word-finding task, along with expected time and space complexity analysis for both.

Related Interview Questions

  • Thread-Safe Token-Bucket Rate Limiter - Uber
  • Quadtree for 2D Geospatial Points - Uber
  • Group Anagrams - Uber
  • Deep Equality of Two Records - Uber (medium)
  • Shortest Path in a Grid with Blocked Cells - Uber (medium)
|Home/Coding & Algorithms/Uber

Build Quadtree and Find Grid Words

Uber logo
Uber
Jan 26, 2026, 12:00 AM
hardSoftware EngineerOnsiteCoding & Algorithms
4
0
Loading...

This interview included two algorithm problems.

  1. Quad-partition tree: Given an n x n binary matrix where n is a power of 2, recursively build a tree representation of the matrix. Each node represents a square region. If all cells in the region have the same value, create a leaf node storing that value. Otherwise, create an internal node with four children in this order: top-left, top-right, bottom-left, bottom-right. Return the root node.
  2. Find dictionary words in a character board: Given an m x n grid of lowercase letters and a list of candidate words, return all words that can be formed by moving horizontally or vertically between adjacent cells. A cell may be used at most once when forming a single word. Return each matching word at most once, in any order.

Discuss the expected time and space complexity for both problems.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Uber•More Software Engineer•Uber Software Engineer•Uber Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.