Meta interview question

Basic SQL and python with test cases.