Microsoft interview question

Coding question about string values