Expedia Group interview question

The answer given was a possible solution. The answer the interviewer wanted involved Reflection.