Apple interview questions are often shared on platforms like LeetCode (discuss forums), Glassdoor, Reddit (r/cscareerquestions), or company-specific prep sites, but no exact match exists for a problem titled "Logistic Regression Loss Function" with those precise tags (Machine Learning, Math, Classification) based on available data.[1][5]
Interview problems on logistic regression loss typically test derivation, computation, or gradient calculation of binary cross-entropy (log loss). A standard formulation is:
Given training data $$(X \in \mathbb{R}^{n \times d}, y \in {0,1}^n)$$, weights $$w \in \mathbb{R}^d$$, the loss is: $$ L(w) = -\frac{1}{n} \sum_{i=1}^n \left[ y_i \log(\sigma(X_i w)) + (1 - y_i) \log(1 - \sigma(X_i w)) \right] $$ where $$\sigma(z) = \frac{1}{1 + e^{-z}}$$ is the sigmoid.[5][7][1]
No full I/O examples from an "Apple" problem were found, but generic ones include:
Commonly: $$1 \leq n \leq 10^4$$, $$1 \leq d \leq 100$$, $$|X_{ij}| \leq 10$$, no intercept, floating-point precision 1e-9.[5]