Thoughtworks Interview Question

Coding round: How would you add an extra discount offered as an extra use case?

Interview Answer

Anonymous

Jun 6, 2019

Answer: Add that extra if or switch case. But the interviewer was more concerned about how can I refactor his discount in the Price class rather than Product class. Interviewer failed to understand where the business logic should be and the pros and cons of such a design.