Scott Logic interview question

Coding - simple string manipulation algorithms