LendingClub interview question

How do you code this (coding question)?