ServiceNow interview question

Write a function that reverses an array in Java