Apple interview questions
Big tech · 6 questions reported
- junior 0
- mid 2
- senior 4
These are 6 technical questions candidates reported being asked in Apple interviews for AI engineer, ML engineer and applied AI engineer roles, each with a model answer you can say out loud in a minute or two. They cover embeddings, attention, hallucination, cost per request, benchmarking and multimodal: 0 junior, 2 mid-level and 4 senior questions. Every question comes from a public interview write-up that names Apple.Updated
Apple embeddings questions
Model answer
Text arrives on a log. Stream workers tokenize with the tokenizer pinned to the encoder version, embed in GPU micro-batches, and store vectors with ID, timestamp and version.
Scroll sideways to see the whole diagram
The tokenizer turns the sentence into 9 token IDs, including the special tokens [CLS] and [SEP].
Text version
- The tokenizer turns the sentence into 9 token IDs, including the special tokens [CLS] and [SEP].
- Each ID reads its row of the embedding table: 9 static vectors. “bank” gets the same row here as in a sentence about money.
- Six transformer layers let every token's vector take in the others. The output is still 9 vectors, but now each depends on its context.
- Search needs one vector per text, so MiniLM averages the 9 token vectors (mean pooling) into one 384-number vector.
- Finally the vector is scaled to length 1, so cosine similarity and dot product give the same ranking.
Token count, module order (Transformer → mean Pooling → Normalize) and output length measured with sentence-transformers 6.1.0 (all-MiniLM-L6-v2).
Train a light head, logistic regression or an MLP, on frozen embeddings, joining labels by time; retrain periodically and promote only after validating on the newest window.
Serving latency is mostly the encoder: use a small distilled one, batch, and cache repeated texts. Keep training and serving on one embedding version, and backfill when it changes.
Apple attention and the transformer block questions
Model answer
Project once, split into heads, attend in each head, merge.
def mhsa(x, w_qkv, w_o, h): # x: (B, T, d)
B, T, d = x.shape
q, k, v = (x @ w_qkv).split(d, -1)
heads = lambda t: t.view(B, T, h, -1).transpose(1, 2)
q, k, v = heads(q), heads(k), heads(v) # (B, h, T, d/h)
s = q @ k.transpose(-2, -1) / (d // h) ** 0.5
future = torch.ones(T, T, dtype=torch.bool,
device=x.device).triu(1)
s = s.masked_fill(future, float("-inf"))
y = s.softmax(-1) @ v
return y.transpose(1, 2).reshape(B, T, d) @ w_o
Interviewers watch for the mask before softmax, scaling by the head size, not d, and the transpose before the final reshape.
Apple hallucination and limits questions
Model answer
Voice adds two problems: errors start at speech recognition, and the user can't see sources. So use the recogniser's confidence, and confirm an uncertain name or number before acting on it.
Then answer from tools and retrieval, like calendar, contacts and search, not model memory, telling the model to answer only from those results. Check the draft against them before speaking, and confirm before any action. Keep replies short, name the source aloud, and say when it doesn't know. Evaluate on recorded, noisy, accented queries, scoring faithfulness and task success.
Apple cost per request questions
Model answer
Route on what each query needs. The on-device model takes device actions, short answers and private requests: fast, offline, no per-query cost. Open-ended, knowledge-heavy or long reasoning requests go to the server model.
The router is rules for clear intents, then a small on-device classifier scoring difficulty, plus escalation when the local answer's confidence is low. Ask before sending personal context off the device. Track quality per cost and latency: share escalated, quality against always-server on a labelled set, and tail latency. Retrain on misrouted cases.
Apple benchmarking and the capstone questions
Model answer
Agreement tells you whether labels are reliable enough to score against. Raw agreement overstates it, since raters agree by chance; Cohen's kappa corrects for that with two raters, and Krippendorff's alpha handles many raters and missing labels. Low agreement often means a vague rubric.
LLM judges are cheap but biased by position, length and self-preference. Let humans build the gold set; trust a judge once its agreement with them matches human-to-human agreement.
Apple multimodal models questions
Model answer
A vision encoder, usually a ViT trained contrastively like CLIP, cuts the image into patches and embeds each one. A projector, an MLP or a cross-attention resampler, maps those embeddings into the LLM's space, and the LLM reads them as tokens.
The main bottleneck is visual token count: a 336-pixel image with 14-pixel patches is 576 tokens, and high-resolution tiling multiplies that, inflating prefill and the KV cache. Low fixed resolution loses small text, and contrastive encoders capture weak spatial detail. Fixes: token pooling, dynamic tiling, and fine-tuning the encoder.
Each question comes from a public interview write-up or video that names Apple; the answers are ours. Not affiliated with Apple.