Snap interview question

- reverse an array - sort array if monotonic subsequence detected