Frage im Vorstellungsgespräch bei Mastercard

Coding Question : given two paramets of methos a number array and a target integer. write a code in java, it returns index of ints whose sum is target number