Design training job submission to a shared Kubernetes cluster

Multi-tenant ML infrastructure with usability, fairness, observability.
Gateway with artifact caching; namespace quotas; GPU schedulers like Volcano; Prometheus metrics and cost attribution.
What's really being asked
This question evaluates whether you can bridge raw Kubernetes primitives with ML-specific operational needs. The interviewer wants to see multi-tenant design instincts, awareness of batch scheduling nuances for GPUs, and a production-grade observability story. You are expected to move beyond a simple pod spec and discuss lifecycle management, dependency isolation, and fair resource reclamation in a shared cluster.
The full answer
Four layers in order. First, a submission abstraction such as a CLI, SDK, or web portal that translates data scientist code into Kubernetes custom resources like a TrainJob or Pipeline, hiding YAML complexity. Second, dependency management through versioned container images, artifact stores for datasets and models, and possibly an image cache or PVC strategy to avoid repeated large pulls. Third, resource allocation via namespace-level quotas, dedicated GPU node pools, taints and tolerations, and an advanced scheduler such as Volcano, Kueue, or YuniKorn to enable gang scheduling and prevent GPU fragmentation. Fourth, monitoring and cost control using Prometheus for metrics, a logging backend for distributed training logs, and per-namespace or per-user cost attribution to charge back resource usage.
The mistakes people make
Treating training jobs as stateless microservices is the biggest red flag. Answers that rely solely on the default Kubernetes scheduler ignore gang scheduling requirements for distributed training, leading to deadlock when only half of an eight-GPU job lands. Proposing one giant shared PVC for all datasets introduces noisy neighbor issues and security risks. Forgetting checkpoint persistence means data scientists lose days of work on preemption. Ignoring queueing entirely leads to cluster congestion and priority inversion.
What usually comes next
How would you handle preemption and resume a distributed training job that loses a node? What changes if the cluster spans multiple availability zones or on-prem and cloud? How do you schedule interactive notebook pods differently from batch training jobs? What is your strategy for multi-tenancy when one team submits a thousand hyperparameter trials via Katib?
A concrete example
Suppose a team submits a PyTorch distributed job requiring eight GPUs on four nodes. Your gateway writes a TrainJob custom resource. Kueue or Volcano queues the job until the full set of GPUs is available, preventing partial allocation. The job pulls a cached image from a local registry, mounts read-only training data from an object store via a CSI driver, and writes checkpoints to a distributed filesystem every fifteen minutes. Prometheus scrapes GPU utilization and memory metrics, while Loki aggregates logs from all four workers. If the job exceeds its twelve-hour quota or a higher-priority job arrives, the scheduler preempts it, the training framework resumes from the latest checkpoint, and the cost attribution system bills the team for ninety-two GPU-hours consumed.
Interview question
A team submits a distributed training job requiring eight GPUs on four nodes to a shared Kubernetes cluster. What is the main reason to use an advanced scheduler like Volcano or Kueue rather than the default Kubernetes scheduler?
- a.It checkpoints model weights every fifteen minutes to a distributed filesystem
- b.It automatically converts the training script into a TrainJob custom resource and hides YAML complexity
- c.It replaces namespace quotas by assigning dedicated GPU node pools to each team
- d.It ensures the job waits until all eight GPUs are available before placing any pods, avoiding deadlock from partial allocationCorrect
Why? this is the answer
The default scheduler may place only part of a distributed job, causing deadlock while reserved GPUs sit idle; advanced schedulers use gang scheduling to allocate all required resources together. The first distractor confuses the scheduler with the gateway submission abstraction layer described in the card.
Just read this? Test yourself on what you have been reading.
Read the original → kubeflow.org
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on mlops — each one lists the topics its interview covers.
See open roles