Find Every Dictionary Word Hidden in a Sticker Letter Grid

Last updated: November 29, 2026

Quick Overview

Given an m by n grid of letters from a word-game sticker pack and a list of dictionary words, return every word that can be traced by moving between horizontally or vertically adjacent cells without reusing a cell within one word.

Meta
Coding & Algorithms
Software Engineer
Meta
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Hard

0

0

0 solved


Given an m by n grid of letters from a word-game sticker pack and a list of dictionary words, return every word that can be traced by moving between horizontally or vertically adjacent cells without reusing a cell within one word.

This is a classic Meta onsite Hard because the naive approach (one grid search per word) times out, and the fix is to search all words at once with a trie. Interviewers watch for pruning: removing found words and dead branches so later searches get faster.

What the Interviewer Expects
  • Explain why per-word DFS is too slow for large dictionaries
  • Build a trie and DFS the grid once per starting cell
  • Mark visited cells in place and restore them on backtrack
  • Record each word once and prune exhausted trie branches
  • Give a realistic complexity bound
Key Topics to Cover
trie
backtracking
DFS on grid
pruning
multi-pattern search
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you handle diagonal moves too?
  • What if the same cell may be reused within a word?
  • How would you parallelize across starting cells?
  • How would you return the coordinates of each found word?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements
  • Grid cells hold lowercase letters; words are lowercase and may repeat in the input.
  • A word is found if some path spells it with 4-directional moves and no cell reused in that path.
  • Return each f...
High-Level Design

Insert all words into a trie where the terminal node stores the full word. Then start a DFS from every cell, descending in the trie in lockstep with the grid. When a node holds a word, record it and c...


Submit Your Answer
Markdown supported