Build a Prefix Tree

Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.

The problem

  • easy
  • Pro

Design a prefix tree, also called a trie, that can add a word, check whether a whole word was added, and check whether any added word starts with a given prefix. Explain how it's laid out and what each operation costs.

Talk this problem through with an AI coach

This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.

Start free →