KatInterview

Design a Container Job Scheduler and Telemetry Platform

System DesignModel answer
HardModel answerSystem Designsystem-designkubernetesdistributed-systems

Last updated

Design a distributed container execution system featuring resource-constrained scheduling, job lifecycle management, self-fencing node agents, and scalable metric ingestion.

Design a cloud-native platform responsible for scheduling, running, and monitoring batch workloads (containerized jobs) across a large cluster of compute nodes.

Your platform must support multi-tenant job submissions with CPU/memory resource requirements, manage execution lifecycles (retries, timeouts, cancellations), and provide end-to-end metrics collection for both infrastructure health and job performance.

Key Requirements to Address:

  1. API & Data Representation: Design APIs for workload submission, tracking, and cancellation. Define the persistent data model for jobs, execution attempts, and compute nodes.
  2. Scheduling Architecture: Explain resource allocation strategies (filtering, scoring, multi-tenant fairness), and handle race conditions during node binding.
  3. Fault Tolerance & Execution Guarantees: Describe mechanisms for handling node failures, network partitions, job retries (exponential backoff), and double-execution risks.
  4. Telemetry & Observability Engine: Architect a high-throughput metrics ingestion pipeline for system and workload metrics. Support PromQL-like querying and alert evaluation.
  5. Security & Isolation: Address multi-tenant CPU/memory isolation and safe cluster operations.

Hints

Hint 1

Distinguish between control plane needs (strong consistency, lower throughput) and metrics telemetry needs (eventual consistency, high ingestion throughput).

Hint 2

Consider how node heartbeats and distributed leases prevent split-brain execution when a worker node loses connectivity.

Hint 3

Address multi-tenant fairness via Dominant Resource Fairness (DRF) or tenant queues rather than simple strict priority.