Pregunta de entrevista de Swiggy

Write code for linear regression and explain the logic behind it. Basic Python and numpy questions. 1 coding question in SQL and pandas each.