Time limit was 90 minutes, four levels total.
Implement a Working Hours Register: employees badge in and out of the office, and the system records their working hours, with support for promotions, salary calculation, and bonus-period management.
Level 1: Basic CRUD — add an employee, badge an employee in and out, query an employee's total hours worked.
Level 2: Sort employees by hours worked and return the top n.
Level 3: Promotion and salary calculation. Implement a promotion that takes effect with a delay — calling it doesn't change the current position right away, instead the new position and new compensation are held pending, and the switch only happens the next time the employee badges into the office. Use a pending dict to store promotions that are waiting to take effect. Then there's salary calculation billed in segments based on historical salary — an employee's salary is different across different periods, so each session records the salary that was in effect when it happened.
Level 4: Double pay during the grant period. If an entire shift falls completely within the grant period, that shift gets paid double. Also need to support querying how much total double pay has been issued.
Discussion
Loading comments…