Virta interview question

Basic ML questions. The long coding question is a Data science problem