F5 interview question

Coding question about string manipulation.