AI Engineer Portal
Your personal operating system for career transition.
Exercise
Build a human-in-the-loop annotation queue
Build a Human-in-the-Loop Annotation Queue
Automated evaluation is fast but imperfect. An annotation queue routes only the cases where human judgment adds the most value: borderline scores, judge disagreements, and new failure modes.
What to build
Implement AnnotationQueue:
-
enqueue(case_id, prediction, reference, auto_score, priority="normal")— Priority:"high","normal", or"low". RaisesValueErrorifcase_idalready exists. -
next_for_review(reviewer_id) -> dict | None— Returns highest-priority unreviewed case (high > normal > low, then FIFO), marks it"in_review". ReturnsNoneif empty. -
submit_review(case_id, reviewer_id, human_score, notes="") -> dict— Records score, marks"reviewed". Returns{"case_id", "auto_score", "human_score", "delta", "agrees"}whereagrees = abs(delta) <= 0.2. -
stats() -> dict— Returns{"total", "pending", "in_review", "reviewed", "agreement_rate"}.
Constraints
- Standard library only. Use
time.time()for enqueue timestamps.
Evaluation / hard / Step 21 of 36
Evaluation and review loops
Separate the scoring logic from the interpretation logic. Your goal is not just a number; it is a useful next action.
- - Produces a useful signal, not decorative output
- - Makes regression review easier
- - Would support a benchmark or observability loop
- - Would this output help decide what to fix next?
- - Are important failure modes visible?
- - Does the score hide any ambiguity I should record?
Practice
Generate a variation
Generate a new exercise variation to deepen understanding or practice a related concept.
Attempt history
Recent submissions
Before you submit, decide what a strong answer should make obvious to the reviewer.
No attempts yet.