← 返回 openai 的题目列表Incremental Task Scheduling for Human Labelers and Models with Daily Streaming Constraints
类型:online_judge
Problem: Incremental Task Scheduling for Human Labelers and Models (Daily Streaming Constraints)
Design and implement a task scheduler for a data-labeling platform that runs in daily rounds. Each day, a batch of new tasks arrives and must be assigned to (task, model, human) triples.
Actors and Constraints
There is a set of humans (labelers) and a set of models.
Per day:
Each human can complete at most one task.
Each task can be assigned at most once that day (no duplicate assignment of the same task within a day).
History accumulates across days:
The same human must never label the same task twice (if they labeled it in the past, they cannot be assigned to it again).
Objective (Balance/Fairness)
Over time, assignments should be as uniform as possible across humans and models. As new tasks arrive each day, the global distribution should remain balanced.
Incremental Update Requirement
The scheduler must support incremental updates:
Input includes historical assignment records up to yesterday.
When new tasks arrive today, produce today’s schedule without recomputing everything from scratch.
Explain and implement the maintained state (e.g., counters/indices/heaps).
What to Implement
Implement a scheduler interface (you may design classes/methods), including at least:
Initialization (humans, models, historical assignments/counters).
schedule(new_tasks): takes today’s new tasks and outputs a list of assigned triples [(task, model, human), ...].
Sample Tests (Illustrative)
Because the original post did not specify exact I/O, tests focus on validating constraints and demonstrating balancing behavior:
Basic assignment with 2 humans and 2 tasks.
A human cannot be assigned a task they labeled historically.
Multi-day incremental scheduling where load imbalance does not keep growing.
Tasks > humans: only up to #humans tasks assigned.
Multiple models: model usage is kept roughly balanced.
Example
Input
(illustrative)
humans=h1 h2
models=m1
history=0
new_tasks=t1 t2
Output
2 assignments; each human appears at most once