Question d’entretien chez Palantir Technologies

Difficult Algorithm question.