slice interview question

R1 overview: Sql- 80%, Python- 20%