Meta interview question

2 sql questions and 2 cases