AI Interview Prep is optimized for larger screens
Please open this on a laptop or desktop (1024px and wider) to use the full editor, whiteboard, and AI coaching surface.
Understand the problem
Restate the problem precisely. Interviewers reward candidates who pause, define the contract, and name the guarantees before coding.
A trie (pronounced "try") is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. Implement the `Trie` class: - `Trie()` — initializes an empty trie. - `void insert(String word)` — inserts the string `word` into the trie. - `boolean search(String word)` — returns `true` if `word` is in the trie (i.e. was previously inserted). - `boolean startsWith(String prefix)` — returns `true` if there is any inserted word that has `prefix` as a prefix.
Once you've drafted a response, click Submit for AI review and a senior engineer will critique your reasoning.