Microsoft interview question

Trie + string question + one DP + one stack