Netflix interview questions
Big tech · 7 questions reported
- junior 3
- mid 2
- senior 2
These are 7 technical questions candidates reported being asked in Netflix 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 attention, context & kv cache, tokenization, training and ml system design: 3 junior, 2 mid-level and 2 senior questions. Every question comes from a public interview write-up that names Netflix.Updated
Netflix tokenization questions
Model answer
Subword tokenizers keep common words whole and split rare ones into frequent pieces: no unknown words, short sequences. SentencePiece trains on raw text, spaces included, so it needs no language-specific pre-splitting.
Variants: encoder-only like BERT for understanding, decoder-only like GPT for generation, and encoder-decoder like T5 for input-to-output tasks such as translation.
Netflix attention and the transformer block questions
Model answer
Score each token's query against every visible key, divide by √d, softmax, and weight the values. The query is what a token looks for, the key what it offers, the value what it hands over. Dot products grow with d, and large scores push softmax onto one token, where gradients get tiny.
Model answer
Self-attention: each token scores its query against every key, softmaxes, and sums the values by weight.
LoRA: freeze the weights, train a low-rank update.
Adam tracks running averages of each parameter's gradient and squared gradient, giving per-parameter step sizes: the transformer default. SGD uses one global rate and less memory; it often generalises well in vision.
ViT cuts an image into patches, embeds each as a token, and runs a standard transformer encoder.
Netflix context windows and the KV cache questions
Model answer
It stores every processed token's keys and values, per layer and head, so each decode step computes only the new token's.
Scroll sideways to see the whole diagram
Prefill runs the prompt once and computes the keys and values of all 4 prompt tokens, in every layer and every head. They go into the cache.
Text version
- Prefill runs the prompt once and computes the keys and values of all 4 prompt tokens, in every layer and every head. They go into the cache.
- Each decode step computes the key and value of the new token only, and appends them to the cache.
- The new token's query still attends to every earlier key. Those keys and values are read back from the cache, not recomputed.
- Earlier tokens' keys and values never change, because of the causal mask, so the cache is exact. With a 4-token prompt and 3 new tokens, that is 7 key-value computations with the cache and 22 without.
Counts from the KV-cache lab in lesson 5: a 4-token prompt and 3 new tokens.
It's exact because of the causal mask: earlier tokens never depend on later ones, and greedy output was identical with and without the cache. After a 960-token prompt on our test machine, a step took 9.6 ms with the cache against 228.8 ms without, about 24 times faster.
Model answer
Attention builds each token's output as a weighted mix of other tokens. Each hidden vector is multiplied by three learned matrices to give a query, key and value. Scores are query-key dot products divided by the root of the head size, masked causally in a decoder, softmaxed, then used to average the values.
In decoding, past tokens' keys and values never change, so the KV cache stores them. Each step projects only the new token and attends over the cache, instead of reprocessing the prefix, paying in memory that grows with batch times context.
Netflix training and optimisation questions
Model answer
MSE for regression, cross-entropy for classification. Cross-entropy is the negative log-likelihood of the right class; with softmax its gradient is just predicted minus true, so confident mistakes get big updates, while MSE on probabilities gives them small ones.
LoRA freezes the weights and trains a small low-rank update, so fine-tuning is far cheaper.
Netflix mL system design questions
Model answer
Jobs enter a queue with a priority and a team quota, with fair share across teams. Distributed training needs gang scheduling, all GPUs at once or none, and topology-aware placement on NVLink-connected GPUs in the same node or rack.
Batch inference is the filler: preemptible, sharded into small tasks, backfilling idle GPUs. Preemption relies on checkpointing, and so does recovery: health checks spot failed GPUs, and jobs restart from their last checkpoint. Track utilisation, queue wait per priority and fairness, and give users a clear view of why a job is waiting.
Each question comes from a public interview write-up or video that names Netflix; the answers are ours. Not affiliated with Netflix.