~/problems / Simulation & OOP design / Simulation

Data labeling task scheduler

medium 3 levels ~45 min OpenAI

Level 1 A basic labeling schedule

A labeling platform has t tasks (ids 0..t-1), m models (0..m-1) and h human labelers (0..h-1). A schedule is a list of (task, model, human) tuples: that human labels that model's output on that task.

Write build_basic_schedule(t, m, h, k) -> list[tuple[int, int, int]] | None such that:

  • every human appears in exactly k tuples (this is the shortest schedule where everyone does at least k),
  • no human labels the same task twice,
  • every id is in range.

Return None if any of t, m, h is not positive, if k is negative, or if no schedule exists. Return [] when k == 0. Think first about when a schedule is impossible. Any valid schedule is accepted, and the model can be anything in range.

build_basic_schedule(3, 2, 2, 2)
# e.g. [(0, 0, 0), (1, 0, 0), (1, 0, 1), (2, 0, 1)]
build_basic_schedule(2, 1, 5, 3)   # None: a human can do at most 2 distinct tasks

Level 2 unlocks when level 1 passes.

Level 3 unlocks when level 2 passes.

Topic: Simulation. Model the process exactly; watch simultaneous updates and direction arithmetic.

0:00
Ctrl ' run · Ctrl ↵ submit
esc