Skip to main content
InterviewHubPRO
HomeTracksSection 34: Kubernetes (K8s) (50 Qs)
Section 34 of 6450 Questions (1 Per Page)

Kubernetes & Cloud-Native Orchestration Master Interview Bank

K8s control plane architecture (etcd, kube-scheduler), Pod lifecycle, Deployments, Services, Ingress, CNI networking, CSI volumes, and HPA autoscaling.

Curriculum Roadmap & Learning Path

3 Stages
Tip: Click any stage card above to instantly filter the question bank to that topic.3 Connected Milestones
50 of 50 Qs

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

13 Questions
1
Most AskedJunior#Docker & Containers#Kubernetes

What is Kubernetes (K8s), and why is it needed over bare Docker containers?

While Docker packages and runs individual containers on a single host, running distributed production systems requires managing hundreds of containers across dozens of physical or cloud servers.

2
Most AskedJuniorCode#Kubernetes

What is a Pod, and why is it the smallest deployable unit in Kubernetes?

Kubernetes does not run containers directly; it wraps one or more containers into a Pod.: Shared Context: All containers in a Pod share the exact same • Network Namespace: Same IP address, port space, and localhost loopback interface • Storage Volumes: Mounted storage volumes can be accessed simultaneously by all containers in the Pod.

3
Most AskedJunior#Kubernetes

What are Namespaces in Kubernetes and what are their isolation boundaries?

A Namespace is a logical partition or virtual cluster within a single physical Kubernetes cluster.: Default Namespaces • default: Default space for user workloads • kube-system: Reserved for core Kubernetes control plane and add-on components (CoreDNS, kube-proxy) • kube-public: Universally readable namespace for public cluster discovery.

4
Most AskedJuniorCode#kubernetes#Basic

Imperative (`kubectl create/run`) vs. Declarative (`kubectl apply -f`) Management.

Imperative Management: You tell Kubernetes what actions to perform step-by-step.

5
JuniorCode#kubernetes#Basic

Essential `kubectl` Commands for Daily Operations.

Essential daily kubectl commands allow engineers to inspect cluster topology, tail container logs, troubleshoot pod scheduling events, and apply declarative YAML configurations. #### Code Example.

6
Most AskedSenior#Components#Kubernetes

Kubernetes Architecture: Control Plane Components vs. Worker Node Agents.

Control Plane (Master Nodes - The Brain) • kube-apiserver: The front door of Kubernetes • etcd: Distributed key-value store holding 100% of the cluster's state, configurations, and secrets • kube-scheduler: Watches for newly created unscheduled Pods and assigns them to optimal Worker Nodes.

7
Most AskedJunior#Lifecycle#Kubernetes

What is the Pod Lifecycle and what are the Pod Phases?

A Pod progresses through distinct operational phases: Pending: Accepted by API Server, but waiting for scheduling, downloading container images, or waiting for Init Containers to complete • Running: Bound to a node; at least one primary container is actively running or restarting.

8
JuniorCode#kubernetes#Basic

Liveness, Readiness, and Startup Probes: Differences and Use Cases.

Startup Probe • Tests if a slow-starting legacy application (e.g. Java Spring Boot taking 90 seconds to boot) has finished initializing • While running, it disables Liveness and Readiness checks so the Kubelet doesn't mistakenly kill the slow-starting container • Liveness Probe.

9
Junior#Kubernetes

Deployments vs. ReplicaSets vs. StatefulSets: When to use each?

ReplicaSet: Low-level controller that ensures a specified number of identical Pod replicas are running at any given time • Deployment: Higher-level controller that manages ReplicaSets • StatefulSet: Manages stateful workloads (databases like PostgreSQL, Redis clusters, Kafka brokers).

10
Most AskedJunior#Kubernetes

Kubernetes Services: ClusterIP vs. NodePort vs. LoadBalancer vs. Headless.

Pods are ephemeral; when replaced, they receive new IP addresses. A Service provides a single stable IP address and DNS name that load-balances traffic across matching Pods.: ClusterIP (Default) • Exposes the service on a cluster-internal private IP • Accessible only from inside the cluster • NodePort.

11
Most AskedJunior#kubernetes#Basic

ConfigMaps and Secrets: Configuration Management.

ConfigMap: Stores non-confidential configuration (environment variables, config files like nginx.conf) in plaintext key-value pairs • Secret: Stores sensitive data (passwords, TLS certificates, OAuth tokens) • By default, secrets are stored as base64-encoded strings in etcd.

12
Most AskedJunior#kubernetes#Basic

Persistent Volumes (PV), PVCs, and StorageClasses.

Decouples storage infrastructure from application deployment: StorageClass (SC): Defines the storage provisioner and tier (e.g., AWS gp3, GCP pd-ssd, Azure managed-csi) • PersistentVolumeClaim (PVC): A request for storage submitted by a developer (e.g., "I need 50GB of ReadWriteOnce SSD storage").

13
JuniorCode#kubernetes#Basic

Resource Requests vs. Resource Limits (CPU & Memory).

```yaml resources: requests: cpu: "250m" # 0.25 of a CPU core memory: "512Mi" # 512 Megabytes limits: cpu: "1000m" # 1 full CPU core memory: "1Gi" # 1 Gigabyte.

Part 2: Core Architecture & Implementation (Mid-Level)

11 Questions
14
Senior#System Design

The etcd Distributed Datastore: Raft Consensus, Quorum, and Latency.

etcd is a strongly consistent (CP), distributed key-value store using the Raft consensus algorithm. Every Kubernetes object is stored in etcd under keys prefixed with /registry/. \text{Quorum} = \left\lfloor \frac{N}{2} \right\rfloor + 1: A 3-node etcd cluster tolerates 1 failure (2 required for quorum).

15
SeniorCode#Lifecycle#Security & Auth

Kube-API Server Request Lifecycle: Authentication, Authorization, and Admission Controllers.

Every request to kube-apiserver passes through a strict 3-phase pipeline before being committed to etcd.

16
Most AskedSenior#System Design

Kube-Scheduler Deep-Dive: Filtering, Scoring, Affinity, Taints, and Tolerations.

The scheduler assigns unscheduled Pods to optimal worker nodes in a two-phase process: Filtering (Predicates): Eliminates unqualified nodes • Does the node have enough unreserved CPU/memory requests? • Does the node match Pod nodeSelector / nodeAffinity? • Does the node have a Taint that the Pod cannot Tolerate?.

17
Most AskedSenior#Kubernetes#System Design

Ingress Controllers vs. Kubernetes Gateway API.

Ingress (Legacy Standard) • Manages external HTTP/HTTPS routing into services using hostnames and paths • Limitations: Tightly coupled; single manifest defines both routing rules and infrastructure configuration; poor support for non-HTTP protocols • Kubernetes Gateway API (Modern Replacement).

18
Most AskedSenior#Kubernetes#System Design

Kubernetes Networking Model & CNI: Calico vs. Cilium (eBPF).

The fundamental rule of Kubernetes networking: Every Pod gets its own unique IP address, and all Pods can communicate with all other Pods without NAT. A Container Network Interface (CNI) plugin implements this model: Calico: Uses standard Linux iptables and BGP routing to manage Pod routing and NetworkPolicies • Cilium (Modern Standard).

19
Most AskedSeniorCode#Kubernetes#System Design

Kubernetes Network Policies & Microsegmentation.

By default, Kubernetes has a flat, open network: any Pod can establish a network socket to any other Pod in the cluster. A NetworkPolicy acts as a stateful firewall for Pods.

20
Most AskedSenior#Kubernetes#System Design

Horizontal Pod Autoscaler (HPA) vs. Vertical Pod Autoscaler (VPA) vs. KEDA.

Horizontal Pod Autoscaler (HPA): Scales the number of pod replicas up or down based on CPU, memory, or custom metrics • Vertical Pod Autoscaler (VPA): Adjusts the CPU and memory requests/limits of existing pods • Warning: Running HPA and VPA on the same resource on CPU/Memory causes catastrophic scaling oscillation fights!

21
Most AskedSenior#Kubernetes#System Design

Cluster Autoscaling: Kubernetes Cluster Autoscaler vs. Karpenter.

When new Pods cannot be scheduled because nodes have exhausted their CPU/RAM requests: Kubernetes Cluster Autoscaler (CAS) • Tightly coupled to Cloud Auto Scaling Groups (ASGs) • Slow (takes 3 to 7 minutes to provision nodes) • Scales pre-configured homogeneous node groups (e.g. all m5.xlarge).

22
Senior#System Design

Quality of Service (QoS) Classes: Guaranteed vs. Burstable vs. BestEffort.

When a worker node runs out of physical memory, the Kubelet evicts Pods based on their QoS class: Guaranteed (Safest) • requests == limits for both CPU and Memory • Lowest eviction priority • Burstable (Standard).

23
SeniorCode#Hooks#System Design

Zero-Downtime Rolling Updates: `maxSurge`, `maxUnavailable`, and `preStop` Hooks.

To achieve 100% zero dropped connections during a deployment update.

24
Most AskedSenior#Docker & Containers#Kubernetes

Troubleshooting: CrashLoopBackOff, ImagePullBackOff, and Pending Pods.

ImagePullBackOff • Typo in image name or tag • Missing image pull secret for private registry (imagePullSecrets) • Container registry rate limit hit (e.g. Docker Hub anonymous pulls).

Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)

26 Questions
25
Most AskedSenior#Security & Auth#Kubernetes

Kubernetes Role-Based Access Control (RBAC): Least Privilege Architecture.

RBAC regulates who can perform what actions on which Kubernetes resources: Role / ClusterRole: Defines permissions (Verbs: get, list, watch, create, delete) on (Resources: pods, services, secrets) • RoleBinding / ClusterRoleBinding: Binds the role to a Subject (User, Group, or ServiceAccount).

26
SeniorCode#Security & Auth

Custom Resource Definitions (CRDs) and the Operator Pattern.

CRD (Custom Resource Definition): Extends the Kubernetes API with custom schema objects (e.g., PostgresCluster, KafkaTopic) • Operator Pattern: Combines a CRD with a custom Controller running an infinite Reconcile Loop written in Go (using controller-runtime or Kubebuilder).

27
Senior#Security & Auth#Kubernetes

Service Mesh Architecture: Istio vs. Linkerd, Sidecars vs. Ambient Mesh.

A Service Mesh manages microservice-to-microservice traffic at Layer 7: Features: Transparent mutual TLS (mTLS), distributed tracing, circuit breaking, fault injection, and canary traffic splitting • Sidecar Architecture (Classic Istio/Linkerd) • Injects an Envoy proxy container into every single Pod.

28
Most AskedSeniorCode#Security & Auth#Kubernetes

Pod Security Standards (PSS) & Pod Security Admission (PSA).

Replaces the deprecated PodSecurityPolicy (PSP) with native namespace-level enforcement. Three standard tiers: Privileged: Unrestricted; allows containers to run as root, mount host devices, and disable seccomp • Baseline: Minimally restrictive; prevents known privilege escalations • Restricted (Production Standard).

29
SeniorCode#Forms#Performance

Deep Dive: CoreDNS Performance, `ndots:5`, and DNS Latency Spikes.

By default, the Linux /etc/resolv.conf injected by Kubelet into every Pod contains.

30
Most AskedSeniorCode#Security & Auth#Kubernetes

Pod Disruption Budgets (PDB) & Safe Node Maintenance.

When cloud providers perform node upgrades or when Karpenter drains nodes for bin-packing, pods are evicted: If all 3 replicas of your payment API are evicted simultaneously -> Outage! • Pod Disruption Budget (PDB): Enforces high-availability constraints during voluntary disruptions.

31
Senior#Security & Auth

Multi-Tenant Cluster Governance: LimitRanges, ResourceQuotas, and Virtual Clusters (`vcluster`).

Preventing noisy neighbor problems when multiple development teams share one cluster: ResourceQuota: Sets hard limits on total aggregate compute resources per namespace (e.g., Team A can consume at most 40 cores and 100GB RAM).

32
Most AskedSeniorCode#Security & Auth

Handling Ephemeral Storage Evictions.

Pods write logs, build artifacts, and scratch data to /var/lib/kubelet/pods/ on the host disk: If a pod writes a runaway 20GB log file without constraints, the host node disk hits 85% utilization, triggering DiskPressure • Kubelet begins evicting Pods randomly! • Solution: Always define ephemeral-storage requests and limits.

33
SeniorCode#Security & Auth#HTTP & REST APIs

Disaster Recovery: etcd Snapshot Backup, Restores, and Quorum Failures.

Because etcd contains the complete cluster state, disaster recovery procedures must be tested regularly: Automated Snapshot.

34
SeniorCode#Security & Auth#Kubernetes

Observability: Prometheus Pull Model, ServiceMonitors, and OpenTelemetry in K8s.

Monitoring microservices in dynamic Kubernetes environments: ServiceMonitor CRD (Prometheus Operator) • Eliminates hardcoded scrape endpoints in Prometheus config • Automatically discovers pods and scrapes metrics based on Kubernetes service labels.

35
Most AskedSeniorCode#Security & Auth#Kubernetes

Hardening Kubernetes Workloads with Kyverno and Open Policy Agent (OPA) Gatekeeper.

Enforcing corporate security policies at API admission time using validating webhooks: Kyverno Policy Example: Enforcing Read-Only Root Filesystem.

36
Senior#Security & Auth

High-Availability Control Plane Design across Multiple Availability Zones.

In a production enterprise cluster spanning 3 Availability Zones (AZ-a, AZ-b, AZ-c): Deploy 3 Control Plane nodes, placing exactly 1 node per AZ • etcd runs co-located on these 3 nodes (forming a 3-node Raft quorum) • A managed Cloud Network Load Balancer (NLB) sits in front of the 3 kube-apiserver instances on port 6443.

37
Most AskedSenior#Security & Auth#Kubernetes

Kubernetes CSI Driver Internals: Dynamic Volume Snapshots and Cloning.

The Container Storage Interface (CSI) separates storage vendor implementations from core Kubernetes: CSI Components • csi-provisioner: Creates cloud disks when PVCs are declared • csi-attacher: Attaches EBS/GPD volumes to worker EC2/GCE VM instances • csi-snapshotter: Takes point-in-time volume snapshots via VolumeSnapshot CRD.

38
Most AskedSenior#Security & Auth#System Design

Autoscaling with Cluster Proportional Autoscaler and NodeLocal DNSCache.

Core infrastructure services like CoreDNS can become severe performance bottlenecks as cluster node counts grow from 5 to 500: Cluster Proportional Autoscaler (CPA): Automatically scales CoreDNS replica counts proportionally based on the total number of worker nodes and • NodeLocal DNSCache.

39
Senior#Security & Auth

Managing Node Drain, Cordon, and Automated OS Patching (Kured).

kubectl cordon : Marks the node as unschedulable; prevents new Pods from being placed on it without affecting running workloads • kubectl drain --ignore-daemonsets --delete-emptydir-data: Safely evicts all running Pods respecting PodDisruptionBudgets, signaling them to • Kured (Kubernetes Reboot Daemon).

40
Most AskedSenior#Forms#Security & Auth

Architecting an Enterprise Kubernetes Platform: The 10 Golden Production Commandments.

Never deploy raw Pods: Always use Deployments or StatefulSets • Explicit Resource Requests & Limits: Every single container must define both CPU and memory requests • Readiness and Liveness Probes: Mandatory on all production workloads • Enforce Read-Only Root Filesystems & Non-Root Users: No containers running as UID 0.

41
Most AskedSenior#Security & Auth#Kubernetes

Kubernetes Service Types: ClusterIP vs NodePort vs LoadBalancer vs Ingress.

ClusterIP (Default): Exposes service on an internal cluster IP address • NodePort: Opens a static high-range port (30000-32767) on every worker node • LoadBalancer: Provisions a real cloud load balancer (AWS NLB/ALB, GCP LB, Azure LB) with a public IP that routes directly to NodePort/ClusterIP.

42
Most AskedSenior#Security & Auth#Kubernetes

Kubernetes Gateway API: The Evolution of Ingress.

The Gateway API replaces legacy Ingress with a modern, role-oriented routing specification: Separation of Concerns • Infrastructure Architect creates the GatewayClass • Cluster Operator provisions the Gateway (listeners, TLS certificates, IP addresses).

43
Most AskedSenior#Security & Auth

Persistent Storage: StorageClass, PersistentVolume (PV), and PVC.

Decouples storage infrastructure from application deployments: StorageClass: Defines the storage provisioner (e.g. AWS EBS gp3, Azure Disk, Ceph) and dynamic volume allocation parameters.

44
Senior#Security & Auth

StatefulSets and Headless Services.

Deployments treat Pods as interchangeable cattle. StatefulSets treat Pods as unique pets: Stable Identity: Pods are named sequentially (mysql-0, mysql-1, mysql-2) and started/terminated in strict ordinal order.

45
Most AskedSenior#Security & Auth#Kubernetes

Pod Disruption Budgets (PDB) and Zero-Downtime Node Draining.

When upgrading Kubernetes nodes (kubectl drain ), Kubernetes evicts all running Pods from the node: Pod Disruption Budget (PDB): Enforces that a minimum number of Pod replicas (e.g. minAvailable: 2 or maxUnavailable: 25%) must remain online and.

46
Most AskedSenior#Security & Auth#Kubernetes

Pod Placement Controls: Node Affinity, Taints, and Tolerations.

NodeSelector: Basic key-value matching to place pods on specific labeled nodes (disk: ssd) • Node Affinity (requiredDuringScheduling.. • Taints & Tolerations: A Taint on a node (gpu=true:NoSchedule) repels Pods.

47
Senior#Security & Auth#Kubernetes

Service Mesh Architecture: Istio and Ambient Mesh.

A Service Mesh manages service-to-service communication transparently: Sidecar Model: Injects an Envoy proxy container into every application Pod • Core Features • Zero-Trust Mutual TLS (mTLS): Automatic cryptographic encryption and identity verification between services.

48
Most AskedSenior#Security & Auth#Kubernetes

Pod Security Standards (PSS) and Security Context.

Replaces legacy PodSecurityPolicies (PSP) with three admission levels applied via namespace labels: Privileged: Unrestricted execution (system components, network daemons) • Baseline: Minimally restrictive; blocks known privilege escalations.

49
Most AskedSenior#Security & Auth#Kubernetes

The Kubernetes Operator Pattern and CRDs.

An Operator encodes human operational domain knowledge (backing up databases, handling failovers, upgrading clusters) into automated software: Custom Resource Definition (CRD): Extends the Kubernetes API with custom objects (e.g. kind: PostgresCluster).

50
Most AskedSenior#Security & Auth#Kubernetes

Cluster Autoscaling: Horizontal Pod Autoscaler (HPA) vs Karpenter.

Horizontal Pod Autoscaler (HPA): Scales the number of Pod replicas based on CPU, memory, or custom Prometheus metrics • Cluster Autoscaler (Legacy): Scales node groups slowly by launching pre-configured VM instance templates • Karpenter (Next-Gen Node Autoscaler): High-speed, just-in-time node provisioner.