Codup interview question

Write a code to traverse a matrix in spiral order