Google Interview Question

String manipulation question and unit test quetstion