Meta interview question

Technical round to solve scenario using sql and python