Question d’entretien chez Morgan Stanley

2-sum problem with a few variations