IDrive interview question

Given 2 programming problems to solve