PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Uber

Find all dictionary words in a grid

Last updated: Mar 29, 2026

Quick Overview

This question evaluates skills in grid traversal, string-search and pattern-matching techniques, recursive backtracking, and the efficient use of data structures for prefix-based lookup, along with time and space complexity reasoning.

  • medium
  • Uber
  • Coding & Algorithms
  • Software Engineer

Find all dictionary words in a grid

Company: Uber

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are given: - A 2D grid of characters `board` with `m` rows and `n` columns. - A list of strings `words` (a dictionary). A word can be formed by starting from any cell and moving to **adjacent** cells (up, down, left, right). Each cell may be used **at most once** in forming a single word. Return **all distinct** words from `words` that can be formed in the grid. ### Input - `board`: `m x n` array of lowercase letters. - `words`: list of lowercase strings. ### Output - A list (or set) of all dictionary words that appear in the board. ### Constraints (reasonable interview constraints) - `1 <= m, n <= 12` - `1 <= len(words) <= 3 * 10^4` - `1 <= len(word) <= 10` - Letters are lowercase `a-z`. ### Notes - The interviewer hinted that a **trie (prefix tree)** is a common approach, but a **backtracking** solution is also acceptable if performance is addressed.

Quick Answer: This question evaluates skills in grid traversal, string-search and pattern-matching techniques, recursive backtracking, and the efficient use of data structures for prefix-based lookup, along with time and space complexity reasoning.

Related Interview Questions

  • Maximize Throughput and Count Trigger Components - Uber (medium)
  • Replace Dashes With Nearest Letters - Uber (medium)
  • Find Earliest Column With One - Uber (easy)
  • Solve Wonderful Strings and Grid Queries - Uber (hard)
  • Count Islands After Land Additions - Uber (medium)
Uber logo
Uber
Jan 22, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
13
0
Loading...

You are given:

  • A 2D grid of characters board with m rows and n columns.
  • A list of strings words (a dictionary).

A word can be formed by starting from any cell and moving to adjacent cells (up, down, left, right). Each cell may be used at most once in forming a single word.

Return all distinct words from words that can be formed in the grid.

Input

  • board : m x n array of lowercase letters.
  • words : list of lowercase strings.

Output

  • A list (or set) of all dictionary words that appear in the board.

Constraints (reasonable interview constraints)

  • 1 <= m, n <= 12
  • 1 <= len(words) <= 3 * 10^4
  • 1 <= len(word) <= 10
  • Letters are lowercase a-z .

Notes

  • The interviewer hinted that a trie (prefix tree) is a common approach, but a backtracking solution is also acceptable if performance is addressed.

Submit Your Answer

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,500+ 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
  • Compare Platforms
  • Discord Community

Support

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

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.