X by 2 Interview Question

Questions about object-oriented program