If the model fits but you want throughput, use data parallelism: replicate the model, split the batch, all reduce the gradients. If it does not fit, shard it. Tensor parallelism splits individual layers across devices, pipeline parallelism assigns different layers to different stages, and fully sharded data parallel splits parameters, gradients, and optimizer state across ranks. Large runs usually combine them.
Why interviewers ask this
This separates candidates who have trained on a cluster from candidates who have only used a single GPU. The interviewer wants the distinction between does not fit and is too slow, since those call for different tools. Naming FSDP or ZeRO style sharding, and understanding that optimizer state often dominates memory rather than the weights, is the detail that shows real exposure.
How to structure your answer
- Separate the too slow problem from the does not fit problem.
- Describe data parallelism and the all reduce step.
- Describe tensor and pipeline sharding in one line each.
- Mention sharding optimizer state and where communication becomes the bottleneck.
Example answer
First question is whether it does not fit or it is just slow, because those are different problems. If it fits, data parallel is the easy win: every GPU holds a full replica, each takes a slice of the batch, and you all reduce gradients before the step. That scales well until the all reduce saturates your interconnect. If it genuinely does not fit, I look at memory composition first, because with Adam the optimizer state is roughly twice the parameter count in fp32, so the weights are often the minority of the footprint. That points straight at sharded data parallel, FSDP or ZeRO stage three, which splits parameters, gradients, and optimizer state across ranks and gathers them just in time. That is usually enough and it keeps the programming model simple. Beyond that you go tensor parallel, splitting the matmuls inside a layer across devices, which needs fast interconnect because it communicates every layer, so I keep it inside a node. Pipeline parallel puts different layers on different devices and you fight bubble overhead with micro batching. Before any of it I try gradient checkpointing and mixed precision, because sometimes that alone gets you back under the limit.
Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.
See how it worksFollow-up questions to expect
- What does gradient checkpointing cost you in compute?
- Why does tensor parallelism want to stay inside a single node?
- How does the pipeline bubble scale with the number of stages?
Related machine learning engineer questions
Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.
Predict my questions