Uber·Machine Learning Engineer·Technical Phone Screen
Apr 2026
Uber ML engineer interview, technical phone screen that was basically one meaty coding question about implementing multi-head self-attention from scratch in PyTorch, plus a bunch of follow-up theory questions. No shortcuts allowed, they explicitly said no nn.MultiheadAttention. Felt like a grad school exam.
- Implement a MultiHeadSelfAttention module in PyTorch from scratch, without using any built-in attention layers. The class should accept embed_dim and num_heads, and the forward pass should take a tensor of shape (batch, seq_len, embed_dim) plus an optional mask.
- Why do we scale the dot products by the square root of the head dimension before applying softmax?
- What's the difference between causal attention and bidirectional attention, and how would you implement a causal mask?
- Walk through the shape of the tensor at each step of the multi-head attention computation.
- What is the time and memory complexity of self-attention with respect to sequence length?
“This is the kind of question where you think you know it until you're actually writing the code.” The rest of the author's notes on Machine Learning Engineer interview at Uber, Technical Phone Screen round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
View Post