Find all dictionary words in a grid
Company: Uber
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
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.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ([['o','a','a','n'],['e','t','a','e'],['i','h','k','r'],['i','f','l','v']], ['oath','pea','eat','rain'])
Expected Output: ['eat', 'oath']
Explanation: Classic word search.
Input: ([['a']], ['a','b'])
Expected Output: ['a']
Explanation: Single cell.
Hints
- Use deterministic tie-breaking for prompts with multiple valid outputs.
- For design-style APIs, simulate operations with explicit inputs.