American Express interview question

3sum problem and basis os questions