Moody's interview question

question based on sql and project discussion