HONEYWELL | Online Assessment Questions 2022 | Implement Trie (Prefix Tree)

Question · Posted Jun 2026

Problem Statement Implement a Trie (Prefix Tree) data structure that supports the following operations: Functions insert(String word) Inserts a word into the Trie. search(String word) Returns true if the exact word exists in the Trie. Otherwise, returns false. startsWith(String prefix) Returns true if there exists any word in the Trie that starts with the given prefix. Otherwise, returns false. A Trie is an efficient information retrieval data structure commonly used for dictionaries, autocomplete systems, spell checkers, and prefix-based searches. Example ...

The full answer & interview discussion are available to premium members.

Log in Create a free account