Amazon Interview Question

Given a square matrix, implement a function to rotate the matrix 90 degrees.