Microsoft interview question

Some questions about string and array manipulation.