Microsoft interview question

I was asked to solve a DSA style problem.