Dictionary Words by Prefix

Asked at Google · Coding Questions · Difficulty: Medium · Last asked Jul 2, 2026

Build the lookup behind an autocomplete box. The dictionary of words is given once, up front; after that the object answers many queries, and each query is a prefix the user has typed so far. A query returns every dictionary word that starts with that prefix.

Loading the problem…