Loading content...
An operations team is building a deterministic hiring engine for a fixed monthly payroll expansion budget.
Table: Candidates
Budget policy:
Task: Return the employee IDs of every hired candidate under this two-phase policy.
Output requirements:
Supported submission environments:
Candidates:
| employee_id | experience | salary |
|-------------|------------|--------|
| 1 | Junior | 10000 |
| 9 | Junior | 15000 |
| 2 | Senior | 20000 |
| 11 | Senior | 16000 |
| 13 | Senior | 50000 |
| 4 | Junior | 40000 |[
{"employee_id":1},
{"employee_id":2},
{"employee_id":9},
{"employee_id":11}
]Seniors are considered by salary: 16000 (id 11), 20000 (id 2), 50000 (id 13). The first two are hired (36000 total), but id 13 is unaffordable. Remaining budget is 34000, so juniors 10000 (id 1) and 15000 (id 9) are hired, while 40000 (id 4) is not.
Candidates:
| employee_id | experience | salary |
|-------------|------------|--------|
| 1 | Junior | 25000 |
| 9 | Junior | 10000 |
| 2 | Senior | 85000 |
| 11 | Senior | 80000 |
| 13 | Senior | 90000 |
| 4 | Junior | 30000 |[
{"employee_id":1},
{"employee_id":4},
{"employee_id":9}
]No senior can be hired because the cheapest senior salary exceeds 70000. The full budget is then used for juniors in salary order: 10000, 25000, and 30000 are all affordable.
Candidates:
| employee_id | experience | salary |
|-------------|------------|--------|
| 101 | Senior | 30000 |
| 102 | Senior | 40000 |
| 103 | Junior | 5000 |
| 104 | Junior | 6000 |[
{"employee_id":101},
{"employee_id":102}
]Hiring seniors 30000 and 40000 consumes the entire 70000 budget, leaving nothing for juniors.
Constraints