Stage 2, Part 8 of 9 · p. 17, kubectl Mastery & Debugging

PART 8: INTERVIEW PREPARATION

38. Junior-Level Questions

QuestionExpected Answer
What's the difference between kubectl get and kubectl describe?get = summary, describe = detailed + events
How do you see Pod logs?kubectl logs <pod>
How do you switch namespaces?kubectl config set-context --current --namespace=X or -n flag
What's a kubeconfig?Config file with cluster/user/context info
How do you delete a Pod?kubectl delete pod <name>

39. Mid-Level Questions

QuestionExpected Answer
Difference between apply and create?apply = 3-way merge, idempotent. create = one-shot.
How do you get a Pod's IP?kubectl get pod X -o jsonpath='{.status.podIP}'
What's the difference between labels and annotations?Labels are selectable, annotations aren't
How do you debug a distroless container?kubectl debug with ephemeral container
What's the difference between --dry-run=client and =server?client = local; server = full validation including webhooks

40. Senior-Level Questions

QuestionExpected Answer
How do you structure a debugging runbook?Context check → high-level → drill down → specific
How do you safely debug in production?Read-only first, ephemeral containers, break-glass RBAC
What's the difference between strategic merge and JSON patch?Strategic merges by key; JSON patch is precise operations
How do you find which Pod is using all the CPU?kubectl top pods --sort-by=cpu
How do you audit who deleted a resource?Audit logs / event history

41. Staff/Principal Questions

QuestionExpected Answer
Design a standardized kubectl workflow for 100 engineers.Context in prompt, kubectx/kubens, aliases, RBAC, ephemeral debug
How do you prevent wrong-context accidents?Prompt, confirmation prompts, separate kubeconfigs, network isolation
How do you debug at scale across 1000 nodes?Event exporters, log aggregation, kubectl plugins, fleet-wide queries
How do you enforce least privilege for kubectl?RBAC + audit + temporary elevation
How do you train engineers on kubectl?Labs, runbooks, pair debugging, internal docs

1:1 copy of the class Google Doc, code in code blocks.