Unthinkable interview question

Coding questions based on string.