Persistent Systems interview question

1 coding question on strings