Rakuten interview question

Find pairs with a given sum in an array.