X interview question

They are all algorithm question