Fidelity Investments Interview Question

In a technical interview, they ask to write some code, like removing duplicates in arr, binary searching, and squaring the numbers in arr