Ipsos interview question

Another algorithm exercise + basic questions