Munich Re interview question

A coding question, basic of data engineering concept