Backbase interview question

The assignment was the hardest part