Microsoft Interview Question

First question was how to rotate a 2d array and second was how to flip a string.