LeetCodechevron_rightCategorieschevron_righttrie
fork_right

trie

45 problems
Easy: 3Medium: 22Hard: 20

trie is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.

Interview Signal

Frequently tests problem modeling, edge handling, and verbal clarity.

Common Pitfall

Template-only answers break under follow-up questioning.

Practice Strategy

Practice in 3-5 problem rounds and always review complexity alternatives.

Recommended Progression

Problem bank

trie problem bank

Start with a compact scan-friendly list and progressively load more so the topic page stays readable even when the corpus is large.

Progressive topic library

Built for large topic sets: scan the structure first, then go deeper.

hourglass_bottomScroll to continue
search
tuneDifficulty

Showing 24 / 45 problems

+24 per load
#TitleDifficulty
14

Longest Common Prefix

Find the longest common prefix in an array of strings, returning an empty string if none exists.

Easy
139

Word Break

Determine if a string can be fully segmented into dictionary words using array scanning and hash-based lookups for effic…

Medium
140

Word Break II

Given a string and dictionary, return all possible sentences by adding spaces where each word is in the dictionary.

Hard
208

Implement Trie (Prefix Tree)

This problem requires designing a Trie (Prefix Tree) to efficiently store and query strings using hash table concepts fo…

Medium
211

Design Add and Search Words Data Structure

Build a WordDictionary supporting dynamic word addition and search with wildcard matching efficiently using Trie and DFS…

Medium
212

Word Search II

Solve the Word Search II problem using backtracking with pruning to find all words on a board of characters.

Hard
336

Palindrome Pairs

Find all pairs of words in a list that form palindromes when concatenated using efficient scanning and hash mapping.

Hard
386

Lexicographical Numbers

Generate all numbers from 1 to n in lexicographical order using a depth-first search pattern optimized with trie logic f…

Medium
421

Maximum XOR of Two Numbers in an Array

Find the maximum XOR of two numbers in an integer array using efficient bit manipulation techniques.

Medium
440

K-th Smallest in Lexicographical Order

Find the k-th lexicographically smallest integer in a range using a Trie-based approach.

Hard
472

Concatenated Words

Find concatenated words by using dynamic programming and depth-first search to identify valid words made of other words …

Hard
648

Replace Words

Replace words in a sentence using the shortest root from a dictionary, applying efficient array scanning and hash lookup…

Medium
676

Implement Magic Dictionary

Design a Magic Dictionary to allow searching with one-character modifications, using Hash Table and String techniques.

Medium
677

Map Sum Pairs

Design and implement a data structure that supports efficient insertion and sum queries based on string prefixes.

Medium
692

Top K Frequent Words

Solve Top K Frequent Words by counting each word, then ordering ties alphabetically so frequency wins before lexicograph…

Medium
720

Longest Word in Dictionary

Find the longest word in a dictionary that can be built one character at a time from other words in the dictionary.

Medium
745

Prefix and Suffix Search

Design a dictionary to search words by both prefix and suffix using a Trie structure and hash lookups.

Hard
792

Number of Matching Subsequences

Given a string s and a list of words, count how many words are subsequences of s using efficient array scanning and hash…

Medium
820

Short Encoding of Words

Find the minimum length of a reference string encoding an array of words using array scanning and hash lookup efficientl…

Medium
1023

Camelcase Matching

Camelcase Matching is a medium difficulty problem where you match queries to a given pattern by inserting lowercase lett…

Medium
1032

Stream of Characters

Implement a StreamChecker that detects if any suffix of a character stream matches a given list of words using efficient…

Hard
1178

Number of Valid Words for Each Puzzle

Solve the "Number of Valid Words for Each Puzzle" problem with array scanning and hash lookup to efficiently count valid…

Hard
1233

Remove Sub-Folders from the Filesystem

Remove sub-folders in a filesystem by filtering out folders nested inside other folders.

Medium
1268

Search Suggestions System

Design a search suggestion system that provides the top three lexicographically smallest products matching a search word…

Medium

swap_vertScroll inside the bank to auto-load more

Related Patterns

Trie LeetCode Problems: 45 Solutions