Write SQL/pandas for KPI anomaly | Meta Interview Question