X interview question

algorithms