Tries
Store words in a tree with one letter per edge, so words that share a prefix share a path. Reach for it when a problem involves prefixes, autocomplete or many words checked against a board, as in Implement Trie. Lookups cost the word's length, not the dictionary's size.
15 problems · 2 with a video · 3 to practice in an AI round
| # | Problem | Difficulty | Video | AI round |
|---|---|---|---|---|
| 1 | Longest Common Prefix | Easy | ||
| 2 | Word Break | Medium | AI round | |
| 3 | Implement Trie (Prefix Tree) | Medium | — | AI round |
| 4 | Word Search II | Hard | — | AI round |
| 5 | Design Add and Search Words Data Structure | Medium | — | |
| 6 | Top K Frequent Words | Medium | — | |
| 7 | Word Break II | Hard | — | |
| 8 | Maximum XOR of Two Numbers in an Array | Medium | — | |
| 9 | Number of Matching Subsequences | Medium | — | |
| 10 | Search Suggestions System | Medium | — | |
| 11 | Lexicographical Numbers | Medium | — | |
| 12 | Design Search Autocomplete System | Hard | — | |
| 13 | Remove Sub-Folders from the Filesystem | Medium | — | |
| 14 | Design In-Memory File System | Hard | — | |
| 15 | Find the Length of the Longest Common Prefix | Medium | — |
Sort by what interviews ask
Sign in to see how many companies ask each problem, sort all 500 by it or by likes, and tick off what you solve.
Practice in an AI round
Three of these are AI rounds: 30 minutes, an AI agent beside your code, then a scored report.
Practice Word Break in an AI roundYour first AI round is free.