Pregunta de entrevista de Micron Technology

I was asked questions on python DSA and 1 question to write the SQL query