Code Room
CodingMediumcod-g1356
Subject Ml metricsLevel Entry–Mid~14 minCommon in ML systems interviewsIndustries Software development

Question

Your on-call runbook pages the ML team when a spam filter's weekly accuracy drops too far. Each week is summarized as [correct, total] with total >= 1. Accuracy dropped too far when acc_a - acc_b > max_drop_pct / 100, where acc_a = correct_a / total_a is last week and acc_b is this week. Check this exactly with integers: return true when 100 * (correct_a * total_b - correct_b * total_a) > max_drop_pct * total_a * total_b, else false. Do not use floating point. Example: week_a = [90, 100], week_b = [80, 100], max_drop_pct = 5 returns true (a 10-point drop).

Implement
accuracy_dropped(week_a: list[int], week_b: list[int], max_drop_pct: int) → bool
Examples
in[[90,100],[80,100],5]outtrue
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.