X interview question

the questions are 4 random leetcode questions