Code Room
CodingEasycod-g980
Subject Machine learningLevel Entry–Mid~15 minCommon in ML systems interviewsIndustries Software development

Question

Min-max normalize a non-empty list of numbers to the range [0, 1]: each value becomes (x - min) / (max - min). If all values are equal (max == min), the denominator is zero — in that case return a list of all 0.0 of the same length. Round each output to 6 decimal places.

Implement
min_max_normalize(xs: list[float]) → list[float]
Examples
in[[0,5,10]]out[0,0.5,1]
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.