Advanced Deep Learning Interview Questions, issue 2, Mar 23, 2026
The Memory Fragmentation Trap
Senior ML Engineer interview at Meta, and the interviewer asks:
“A junior dev hands you a 500-line PyTorch Out-of-Memory (OOM) stack trace and asks for help. What is your exact debugging workflow before you even think about telling them to ‘just lower the batch size’?”
Don’t say: “I’d look at the bottom of the trace to find the failing layer, check the tensor shapes, and maybe suggest turning on gradient checkpointing.”
OOMs aren’t always about capacity - they’re often allocator fragmentation failures that only surface under peak allocation pressure.
The full answer, with the mechanism and the arithmetic, is for paid subscribers on Substack.