Amazon interview question

A question on trie.