Company Interview Questions · Big Tech
Apple & LinkedIn: ML / AI Engineer
Apple & LinkedIn: ML / AI Engineer Interview Experiences (2025). Rounds, real reported questions and model answers, compiled from public candidate reports (sources at the end). Practice mode hides every answer: say your answer first, press Show answer, then rate yourself. Use 🔁 Review again to build your revision list and 🎲 Random question for a quick drill.
About this interview
Compiled from public candidate reports: Apple Machine Learning Engineer (Cupertino, November 2025: recruiter → HM → tech screen → onsite) and LinkedIn AI Engineer phone screen (United States, April 2025, passed). The questions are paraphrased, and the model answers are written by EasyLearnSpace.
| Apple | ||
|---|---|---|
| Role | Machine Learning Engineer | AI Engineer (mid level) |
| Rounds | Recruiter → hiring manager → technical phone screen → onsite | Phone screen: 1 LeetCode problem + 10 ML concept questions |
| Reported questions | A hard LeetCode problem (not among recent tagged problems); deep resume-based behavioural questions | Overfitting, optimisation, Transformers, linear regression; plus statistics |
| Outcome | No offer (couldn't solve the hard problem) | Passed the screen |
01Rounds at a glance
- Apple: team-specific loops. Expect unpredictable coding and deep questions on everything on your resume.
- LinkedIn: rapid-fire ML fundamentals. Breadth and crisp definitions matter.
02Questions and model answers
Q1
What is overfitting, and how do you detect and prevent it?
- Overfitting: low training error but high validation or test error, because the model memorised noise.
- Detect: train-vs-validation gap, learning curves, cross-validation variance.
- Prevent:
- More data or augmentation.
- Regularisation (L1/L2, dropout).
- Simpler models.
- Early stopping.
- Feature selection.
- Ensembling.
- Proper validation (no leakage).
Q2
Optimisation: why does Adam often converge faster than SGD, and when might SGD generalise better?
- Adam adapts the per-parameter learning rate using first and second moment estimates. It is fast on sparse or noisy gradients and needs little tuning.
- SGD with momentum often generalises better in vision models, because it finds flatter minima. Adam can overfit or converge to sharper solutions.
- AdamW (decoupled weight decay) plus warm-up and cosine decay is the standard for Transformers.
- Tune the learning rate first; it matters more than the optimiser choice.
Q3
State the linear regression assumptions and the closed-form solution.
- Model: y = Xw + ε. The OLS solution is ŵ = (XᵀX)⁻¹Xᵀy, or the pseudo-inverse or QR decomposition for numerical stability.
- Assumptions:
- Linearity.
- Independent errors.
- Homoscedasticity (constant variance).
- Normally distributed errors (for inference).
- No perfect multicollinearity.
- Diagnostics: residual plots, Q-Q plot, VIF. Use Ridge when XᵀX is ill-conditioned.
Q4
Transformers: why is attention scaled by √dₖ?
- For random vectors with unit-variance components, the dot product q·k has variance dₖ. Large values push the softmax into saturated regions with tiny gradients.
- Dividing by √dₖ keeps the scores at unit variance, so the softmax stays in a well-behaved range and training is stable.
Q5
Statistics: what is a p-value, and what is a common misinterpretation?
- p-value: the probability of observing data at least this extreme if the null hypothesis is true.
- It is NOT the probability that the null is true, nor the size of the effect.
- Small p-values with huge samples can come from trivial effects, so report effect sizes and confidence intervals.
- Correct for multiple testing (Bonferroni, Benjamini–Hochberg) and avoid peeking (sequential testing needs special methods).
Q6
Apple hard coding: return the median of two sorted arrays in O(log(min(m, n))).
def find_median(a, b):
if len(a) > len(b): a, b = b, a
m, n = len(a), len(b); lo, hi = 0, m
while lo <= hi:
i = (lo + hi) // 2; j = (m + n + 1) // 2 - i
aL = a[i-1] if i else float("-inf"); aR = a[i] if i < m else float("inf")
bL = b[j-1] if j else float("-inf"); bR = b[j] if j < n else float("inf")
if aL <= bR and bL <= aR:
return max(aL, bL) if (m + n) % 2 else (max(aL, bL) + min(aR, bR)) / 2
if aL > bR: hi = i - 1
else: lo = i + 1
- Binary-search the partition of the smaller array so that the left halves hold half of all the elements. Talk through the invariants and edge cases. Even if you don't finish, a clear approach earns credit.
03How to prepare
- Apple: a broad LeetCode base including hard problems (binary search on answers, DP, graphs), plus deep familiarity with every resume line.
- LinkedIn: rapid-fire ML/stats definitions (overfitting, optimisers, Transformers, regression, p-values) and popular LinkedIn-tagged LeetCode problems.
Sources
Created by Ajeetkumar