Amazon interview question

String operations and array operations