Forseven interview question

exercise with data given ahead