Amazon Interview Question

A question on trie.