Code Room
CodingEasycod-g1069
Subject Ml metricsLevel Mid~15 minCommon in ML systems interviewsIndustries Software development

Question

Given y_true and y_pred (equal-length non-empty lists of numbers), compute the mean absolute error (MAE = mean of |y_true - y_pred|) and the root mean squared error (RMSE = sqrt of the mean of (y_true - y_pred)^2). Return [mae, rmse], each rounded to 6 decimals.

Implement
mae_rmse(y_true: list[float], y_pred: list[float]) → list[float]
Examples
in[[1,2,3],[1,2,3]]out[0,0]
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.