Instruction: Write a function that performs a binary search on a sorted array and returns the index of the element if found, otherwise -1.
Context: This question assesses the candidate's algorithm skills and their ability to implement efficient search algorithms.