Bloomberg interview question

Q. Hackerrank question involving class objects.