Intermediate Level
Mid-level interviews shift from definitions to trade-offs, debugging, and hands-on reasoning. Practice each answer aloud, then drill the follow-ups — that's where mid-level candidates are separated.
Compare Kubernetes and Docker Swarm. When would you pick each?
Model answer: "Both orchestrate containers. Swarm is Docker-native, trivially simple, and fine for small self-managed clusters — but it's effectively unmaintained since 2020 and rarely chosen for new work. Kubernetes is the de facto standard: richer scheduling, operators, ecosystem, and managed offerings (EKS/AKS/GKE). I'd default to managed Kubernetes and only consider lighter options for tiny setups or edge constraints."
Follow-ups you should expect:
- "What does Kubernetes give you that Swarm doesn't?" — the operator pattern, rich RBAC/admission, HPA, the CNCF ecosystem
- "Have you actually operated Kubernetes? What hurt?" — upgrades, stateful workloads, RBAC scoping — have a real story
Common pitfall: reciting the comparison table without an opinion — mid-level interviewers want your decision rationale, not definitions.
How do you roll out a new version of a service with zero downtime?
Model answer: "Default is a Kubernetes rolling update:
maxSurge/maxUnavailablecontrol capacity, and readiness probes gate traffic — new pods only receive requests once they pass health checks, and a stuck rollout aborts itself. For higher-risk releases I'd use canary: shift 5% of traffic, compare error/latency metrics against the baseline, auto-rollback on regression. Prerequisites that make it truly zero-downtime: graceful SIGTERM handling with connection draining, backward-compatible APIs and schemas, and externalized session state."Follow-ups you should expect:
- "What breaks zero-downtime in practice?" — missing SIGTERM handling, incompatible schema changes, non-idempotent APIs
- "Blue-green vs canary — when each?" — atomic switch + instant rollback vs smallest blast radius with metric gates
Common pitfall: listing strategies without the prerequisites — probes, graceful shutdown, and compatibility are what interviewers probe next.
A pod is in CrashLoopBackOff. Walk me through your debugging.
Model answer: "CrashLoopBackOff means the container starts and repeatedly exits. Order of investigation:
kubectl describe podfor events (probe failures, OOM kills),kubectl logs --previousfor the last crashed instance's output — usually a config error or missing dependency. Check the exit code: 137 is OOM-killed or SIGKILLed, 1 is an application error. If it's config, trace where it comes from (ConfigMap/Secret mounted correctly?). If it's a dependency, test reachability from inside the pod with an ephemeral debug container. Common root causes: bad image entrypoint, missing env vars, unreachable database, failed liveness probe settings too aggressive."Follow-ups you should expect:
- "Pod is Running but not receiving traffic?" — readiness probe failing; check the probe config and its endpoint
- "Pod is Pending?" — scheduling failed: resources, taints, PVC binding (see
describeevents)
Common pitfall: jumping to
kubectl logsfirst withoutdescribe— the Events section usually names the failure class before you even read app logs.How do you manage secrets in a CI/CD pipeline and in Kubernetes?
Model answer: "Principle: secrets are injected at runtime from a vault, never stored in Git, images, or CI config. In CI: OIDC federation so the pipeline assumes a short-lived cloud role — no static keys at all; Vault dynamic credentials for databases that expire on their own. In Kubernetes: External Secrets Operator syncing from Vault/Secrets Manager, secrets mounted as files rather than env vars, etcd encryption and RBAC restricting who reads Secret objects. And the non-negotiable: a secret that touched Git history is compromised — rotate it, deletion changes nothing."
Follow-ups you should expect:
- "How do you rotate secrets without downtime?" — dual-credential windows, dynamic credentials, staged rotation
- "What if a pipeline secret leaks?" — immediate revocation, audit what it touched, rotate downstream credentials
Common pitfall: answering "use Vault" and stopping — the lifecycle (rotation, revocation, least privilege) is the senior part.
Explain Terraform state. What problems does it cause and how do you manage them?
Model answer: "State is Terraform's record of what it created — the mapping between config and real resources. It enables plan's diffing and dependency management, and it's the source of its problems: it's sensitive (contains secrets), it must be shared safely (remote backend with locking so two applies can't corrupt it), and it can drift from reality. Management: remote state in S3/GCS with locking and encryption, one state per environment/stack for blast radius, never hand-edit (use
terraform statecommands), and drift detection on a schedule.terraform importis the rescue path for resources created outside Terraform."Follow-ups you should expect:
- "Two engineers run apply at once — what happens?" — locking: second fails; stale lock needs verified force-unlock
- "State file got deleted — now what?" — restore from backup, or
importeverything; this is why state backups exist
Common pitfall: knowing state exists but not the locking/blast-radius/secret-handling practices around it.
How would you design monitoring for a new microservice from scratch?
Model answer: "Start with RED on the service: rate, errors, duration — dashboards first. Instrument with OpenTelemetry, expose Prometheus metrics, and add a service-specific health endpoint. Alerts only on symptoms a human must act on: error-rate burn against the SLO, p99 latency regression — with
forwindows and severity routing through Alertmanager. Add distributed tracing with trace IDs correlated into logs. Finally, document the dashboard and alerts in the service repo — monitoring config is code, reviewed with the service."Follow-ups you should expect:
- "What would you NOT alert on?" — internal CPU spikes, anything without an action
- "What's an SLO and how does it drive alerts?" — target reliability; error-budget burn-rate alerting instead of static thresholds
Common pitfall: tool-first answers ("install Prometheus and Grafana") — the interview is about what to measure and why, not which chart to click.
How do you secure a CI/CD pipeline end to end?
Model answer: "Treat the pipeline as production infrastructure — it holds credentials and writes to prod. Layers: identity (OIDC federation, no static keys, least privilege per job), code gates (protected branches, required reviews, green-pipeline requirements), untrusted code isolation (fork PRs on ephemeral runners without secrets), supply chain (pin actions by SHA, lock dependencies, scan SAST/SCA/images, sign artifacts, SBOMs), and verification at deploy (signature admission, protected environments with approvals). Then audit everything — who changed workflow files is as important as who changed application code."
Follow-ups you should expect:
- "A dependency turns out malicious — what limits the damage?" — lockfiles, scanning, pinned digests, blast-radius-scoped CI credentials
- "Why is
pull_request_targetdangerous?" — runs fork code with secrets/privileges unless carefully structured
Common pitfall: naming scanners without the identity/isolation story — the pipeline's own credentials are the real prize attackers chase.
What's the difference between a Deployment, StatefulSet, and DaemonSet — and when do you use each?
Model answer: "Deployment manages stateless replicas — pods are interchangeable, scale freely, rolling updates by default; your web/API tier. StatefulSet manages workloads needing stable identity and storage — guaranteed pod names/order, per-pod PersistentVolumeClaims that survive rescheduling; databases and queues (with the caveat that you also need real data-layer HA — StatefulSet alone isn't it). DaemonSet runs exactly one pod per node — node-level agents: log collectors (Fluent Bit), node exporters, CNI drivers."
Follow-ups you should expect:
- "Why do databases in Kubernetes need more than a StatefulSet?" — failover, backup, and upgrade logic = the Operator pattern
- "How does a StatefulSet pod keep its storage?" — PVCs by identity (
data-db-0), not shared volumes
Common pitfall: saying "StatefulSet is for databases" and stopping — the why (identity + storage coupling) and the operator caveat are what they probe.
How do you make database changes safe in CI/CD?
Model answer: "The constraint: code rolls back instantly, data doesn't. So every migration must be backward-compatible with the previous app version — the expand/contract pattern: add the new column and backfill (expand), deploy code that writes to both, then remove the old column releases later (contract). Migrations run as a pipeline step before the new app starts, using versioned tools (Flyway/Liquibase). Guardrails: validate against a production-scale copy, snapshot first, never couple destructive changes to a deploy, and prevent concurrent migration runs."
Follow-ups you should expect:
- "How do you roll back a bad migration?" — you often don't: forward-fix with a corrective migration; backward-compatibility is what made rollback possible at all
- "Flyway undo?" — paid feature; don't design around it
Common pitfall: saying "we test migrations in staging" without the expand/contract design — the compatibility discipline is the actual answer.
How do you troubleshoot an application that's slow — end to end?
Model answer: "Start from the user symptom and walk the path. Is it global or specific? (metrics: error rate, p95/p99 by endpoint). If a specific endpoint regressed, what changed — deployment annotation on the dashboard, config, dependency version? Traces show where time goes in the request chain — which hop added latency. Then the resource layer for that hop: USE checks — utilization, saturation (connection pools, thread pools, disk IO), errors. Common finds: a slow downstream query (missing index), connection-pool saturation, GC pressure, or a noisy neighbor. Fix, verify against the same metrics, and add a regression alert if the gap wasn't covered."
Follow-ups you should expect:
- "You have no traces — now what?" — logs with timing data, stepwise bisection with feature flags, infrastructure metrics correlation
- "What's saturation and why does it matter more than utilization?" — queued work is the leading indicator; 60% utilized with a queue is worse than 90% with none
Common pitfall: jumping to "check CPU" — the structured path (symptom → scope → change correlation → trace → resource) is what they're grading.
How do you approach a DevOps migration from manual deployments to CI/CD?
Model answer: "Incrementally, with the riskiest manual step automated first — not a big-bang platform. Sequence I'd propose: (1) get everything into Git, including deployment scripts; (2) automate the build/test pipeline for one pilot team — fast feedback wins hearts; (3) automate deploys to a non-prod environment; (4) add production deploys behind the same gates with rollback proven; (5) IaC for new infrastructure, codifying old as it's touched. Alongside: blameless post-incident reviews and documentation-as-code so culture follows the tooling. Measure with DORA metrics to show progress honestly — frequency and lead time up, failure rate flat or down."
Follow-ups you should expect:
- "How do you handle resistance?" — make the automated path easier than the manual one; early wins with a willing pilot team
- "What's the first thing you'd automate?" — whatever breaks most often or blocks the pilot team most
Common pitfall: proposing a tool rollout before a process pilot — migrations fail culturally, not technically.
What questions do you ask to decide between fixing forward and rolling back during an incident?
Model answer: "Four factors: reversibility (can I safely return to the previous version — compatible schema? external side effects?), time-to-fix (is the fix understood and testable in less than rollback time?), blast radius growth (is damage still spreading while we decide?), and state (did the bad version corrupt data that rollback would strand?). Default: roll back or flag-off first, debug calmly after — unless rollback itself is destructive, in which case fix-forward with a targeted change behind review."
Follow-ups you should expect:
- "Who makes the call?" — the incident commander, with the engineer who knows the change proposing options
- "How do you prevent the next one?" — the post-mortem action item feeding the pipeline/feature-flag practice
Common pitfall: treating it as a technical-only decision — the business impact window and communication flow are part of a complete answer.
Contribute & Stay Updated
Want to contribute? We welcome contributions! If you have insights, new tools, or improvements, feel free to submit a pull request.
How to Contribute?
- Read the CONTRIBUTING.md guide.
- Fix errors, add missing topics, or suggest improvements.
- Submit a pull request with your updates.
Community & Support
GitHub: @NotHarshhaa Blog: ProDevOpsGuy Telegram Community: Join Here