Skip to content
tezvyn:

Docker & Kubernetes

Containers, Helm, orchestration, service mesh

144 bites

Test yourself: Top 30 Docker & Kubernetes interview questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Interview questions in Docker & Kubernetes, page 5

advanced1 min read

How do you resize a live PersistentVolume?

Edit the PVC's requested size upward; the StorageClass must set allowVolumeExpansion true and the CSI driver must support expansion, ideally online so no Pod restart is needed; shrinking is not allowed.

easy1 min read

Requests vs limits for CPU and memory?

Requests guide scheduling and reservation, limits cap usage; exceeding a CPU limit throttles the container, while exceeding a memory limit triggers an OOMKill since memory is incompressible.

easy1 min read

How do you pin a Pod to nodes with a given label?

The simplest tool is nodeSelector, a key-value map in the Pod spec requiring matching node labels; node affinity is the richer alternative for complex rules.

easy1 min read

How do you stop new Pods scheduling on a node?

Kubectl cordon marks the node unschedulable so no new Pods land, while existing Pods keep running; drain is the follow-up that also evicts them.

intermediate1 min read

What are the three Pod QoS classes?

Guaranteed when every container sets equal requests and limits for CPU and memory; Burstable when requests are set but not matching limits; BestEffort when none are set; lower classes are evicted first under…

intermediate1 min read

Required vs preferred node affinity rules

Required is a mandatory filter, preferred is a weighted preference, and IgnoredDuringExecution means rules apply only at scheduling time.

intermediate1 min read

Spreading replicas across availability zones

Use topologySpreadConstraints on topology.kubernetes.io/zone with a small maxSkew, choose DoNotSchedule or ScheduleAnyway, and confirm nodes carry zone labels.

intermediate1 min read

Taints and tolerations versus node affinity

Taints repel pods from nodes (reserve hardware), affinity attracts pods to nodes, and you combine both so only tolerating pods land AND only those pods seek the node.

advanced1 min read

Pinning exclusive CPU cores to a pod

Set kubelet CPU Manager policy to static, make the pod Guaranteed QoS with integer CPU limits equal to requests, so it gets exclusive dedicated cores.

advanced1 min read

tolerationSeconds and graceful eviction on NoExecute

TolerationSeconds is how long a tolerating pod may stay after the taint applies; once it elapses eviction starts, then terminationGracePeriodSeconds governs the SIGTERM-to-SIGKILL window.

advanced1 min read

Topology spread constraints versus pod anti-affinity

Spread constraints balance pod counts per domain bounded by maxSkew, anti-affinity is all-or-nothing co-location avoidance, and maxSkew caps the difference between fullest and emptiest…

easy1 min read

Role versus ClusterRole in RBAC

Role is namespaced, ClusterRole is cluster-wide and covers cluster-scoped resources, and you grant either via a RoleBinding (namespaced) or ClusterRoleBinding (cluster-wide) to a subject.

easy1 min read

First NetworkPolicy flips a pod to default-deny

Once any policy selects a pod for a direction, that direction becomes default-deny and only explicitly allowed traffic passes; unselected pods stay open.

intermediate1 min read

Troubleshooting an RBAC forbidden error

Use kubectl auth can-i with --as impersonation to check the verb, inspect RoleBindings and ClusterRoleBindings, and read the role rules.

intermediate1 min read

Namespace-scoped RBAC for a ServiceAccount

Create a Role in production granting create on deployments (apps group) and services (core group), then a RoleBinding tying that Role to the ServiceAccount.

intermediate1 min read

Write a frontend-to-backend NetworkPolicy

Set podSelector to app=backend, policyTypes Ingress, one ingress rule with from podSelector app=frontend and ports TCP 8080; the implicit deny handles the rest.

intermediate1 min read

Root and NET_ADMIN under Pod Security Standards

Set runAsUser 0 and capabilities add NET_ADMIN in the container securityContext; this is rejected by Restricted and Baseline, so the namespace must use the Privileged profile.

advanced1 min read

Binding a ClusterRole with a RoleBinding

A RoleBinding referencing a ClusterRole grants those rules only within the binding's namespace; reuse built-in roles like view per-team without duplicating definitions.

advanced1 min read

Multi-tenant isolation with a monitoring exception

Apply default-deny ingress per tenant namespace, allow same-namespace traffic, then add an ingress rule permitting the monitoring namespace via namespaceSelector on the metrics port.

easy1 min read

Viewing pod logs and durable log collection

Kubectl logs (with -c, --previous, -f) reads container stdout/stderr; because that storage is ephemeral, run a node-level logging agent as a DaemonSet shipping logs to a central store.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles