InterviewDB Experience

Word Match - Find All Dictionary Words Present in a Grid of Letters

Interview Experience

Problem Given an m x n grid of characters and a list of dictionary words, find all words that can be formed by traversing adjacent cells (up/down/left/right/diagonal). Each cell may be used at most once per word. Example: Approach Build a trie from the word list. DFS from each cell, traversing the trie simultaneously. Prune paths not in the trie. Mark cells visited during a path; unmark on backtrack. Time: O(mn4^L) where L = max word length, but trie pruning cuts it drastically in practice. Foll…

Full Details

🔒

Unlock all Grammarly questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a candidate experience report from a grammarly interview during the phone round.

It covers the following topics: Phone, Graph, Trie, Coding, Backtracking, Onsite, Matrix .