Search
⌘K

Leetcode 211. Design Add and Search Words Data Structure

Design a data structure supporting addWord(word) and search(pattern) where '.' in the pattern matches any single letter; the core challenge is efficient pattern matching with wildcards, typically solved with a trie plus DFS/backtracking on '.' nodes. Expect up to 10^4 operations and word length ≤ 25, so trie-based solutions meet the performance constraints.

Asked at:

Microsoft

Microsoft


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early November, 2025

Microsoft

Microsoft

Mid-level

Comments

Your account is free and you can post anonymously if you choose.