Qualcomm interview question

I was asked to do two-sums efficiently.