Amazon interview question

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