Meta interview question

4 medium leetcode type questions. I cannot provide much details