Microsoft interview question

String-based question in both screening