Amazon interview question

Coding task: rotate an integer array by given offset.