Code Room
CodingEasycod-g979
Subject Ml algorithmsLevel Entry–Mid~12 minCommon in ML systems interviewsIndustries Software development

Question

Implement the logistic sigmoid function applied elementwise to a list of real numbers. Sigmoid(x) = 1 / (1 + exp(-x)). To avoid math range overflow for very negative inputs, use the equivalent stable form exp(x) / (1 + exp(x)) when x is negative. Return the list of outputs, each rounded to 6 decimal places. The input list may be empty (return an empty list).

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