Problem statement
Design the object model and core APIs for a payroll calculator that turns an employee's gross pay for a period into net pay by running an ordered pipeline of pre-tax deductions, tax withholdings, and post-tax deductions, while maintaining year-to-date accumulators.
Operating context. For each pay period an employee has gross earnings from salary, hourly work, overtime, and bonuses. The engine applies, in a defined order: pre-tax deductions (retirement contributions, health premiums), tax withholdings (income and payroll taxes, some capped by a year-to-date wage base), and post-tax deductions (garnishments, after-tax savings); it then computes employer-side contributions that do not reduce net pay. It produces a pay stub itemizing every component and updates the employee's running year-to-date totals. Deduction, tax, and contribution rules are pluggable and ordered. The engine runs in a single process.
Out of scope. Tax-law correctness and filing, payment disbursement or ACH, time-clock capture, benefits enrollment, a persistence layer, and multi-currency.
What to produce. The class hierarchy (Employee, PayPeriod, EarningLine, deduction / tax / contribution rules, the payroll pipeline, a year-to-date accumulator, PayStub), the public APIs each exposes, the ordered computation pipeline, and how a capped withholding reads and updates year-to-date state. Be explicit about how rule ordering is data-driven and how each rule stays independently testable.
Requirements
This assessment is a Premium feature.
The statement above is free to read. The functional and non-functional requirements, and the graded canvas that scores your design against them, come with Premium.
Topics
- System Design LLD
- Oop Solid
- Patterns Strategy
- Patterns Chain-Of-Responsibility
- Finance Payroll