Implement Multi-Head Attention from Scratch
Company: ByteDance
Role: Applied Scientist
Category: Machine Learning
Difficulty: medium
Interview Round: Technical Screen
Overview: An ML coding question asking you to implement multi-head attention from scratch in NumPy or PyTorch, from the query, key and value projections to the output projection. It tests tensor shape handling, scaled dot-product attention, masking, numerical stability and complexity analysis.