Google interview question

String manipulation question and unit test quetstion