Code Room
CodingEasycod-g1344
Subject Ml metricsLevel Entry–Mid~10 minCommon in ML systems · Algorithms & data structures interviewsIndustries Software development

Question

A growth team's model forecasts daily sign-ups, and the eval report penalizes big misses much more than small ones by using squared error. Given non-empty equal-length integer lists y_true (actual sign-ups) and y_pred (forecasts), compute the sum of (y_true[i] - y_pred[i])^2 over all days, divide by the number of days, and return the result rounded down to an integer. Example: y_true = [100, 200], y_pred = [110, 190] gives (100 + 100) / 2 = 100.

Implement
squared_error_floor(y_true: list[int], y_pred: list[int]) → int
Examples
in[[100,200],[110,190]]out100
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.