Back to problems

Employee Total-Cost Object Model

Low-Level Design · Amazon · Medium

Table-Driven Cost Calculation Calculating the total cost of an employee involves multiple independent contributors: base salary, taxes, benefits, and geographic adjustments. Hard‑wiring all of those rules inside the Employee class would turn a simple data holder into a fragile monolith—every time a tax rate changes or a new benefit tier is introduced, the class must be modified. The cleaner alternative is to keep the employee focused on its own identity, while placing each…

Checking your access…