Interview Prep — DevOps Track
DevOps Interview Questions
29 questions on containers, orchestration, pipelines, Linux, observability, and incident response — with practical answers.
Docker/K8sCI/CDLinuxSRE
29Total Qs
8Beginner
17Intermediate
2Advanced
2FAANG
Questions
01
What problem does Docker solve?
Docker
Beginner
▾
Packages app + dependencies into immutable images running as isolated containers — consistent dev/staging/prod, faster onboarding, denser utilization than VMs.
02
Image vs container in Docker.
Docker
Beginner
▾
Image is read-only template (layers). Container is running instance with writable layer. Many containers from one image.
03
What is a Kubernetes Pod?
Kubernetes
Beginner
▾
Smallest deployable unit — one or more containers sharing network namespace and volumes. Scheduled onto nodes by control plane.
04
Explain CI vs CD.
CI/CD
Beginner
▾
CI: integrate code frequently with automated build/test. CD: deliver artifacts to environments automatically — continuous delivery (manual prod) or deployment (auto prod with gates).
05
What is infrastructure as code?
IaC
Beginner
▾
Declarative or imperative definitions of infrastructure in version control — reproducible environments, reviewable changes, drift detection (Terraform, CloudFormation, Pulumi).
06
chmod 755 meaning.
Linux
Beginner
▾
Owner rwx (7), group rx (5), others rx (5). Common for directories and executables — owner full control, others read/execute only.
07
What does kubectl apply do?
Kubernetes
Intermediate
▾
Declaratively create/update resources from YAML. API server reconciles desired state. Prefer apply over imperative create for GitOps workflows.
08
Rolling vs blue-green deployment.
CI/CD
Intermediate
▾
Rolling gradually replaces instances — minimal extra capacity. Blue-green runs two full stacks, switches traffic — fast rollback, double capacity cost during cutover.
09
Prometheus pull model — pros/cons.
Monitoring
Intermediate
▾
Server scrapes /metrics endpoints — discovers targets via service discovery, central config. Con: must reach targets through firewalls; pro: no agent push auth sprawl.
10
Terraform state file purpose.
Terraform
Intermediate
▾
Maps config to real resource IDs for updates/destroys. Must be remote + locked (S3+DynamoDB) for teams. Losing state risks duplicate resources on next apply.
11
Ansible vs Terraform.
Ansible
Intermediate
▾
Terraform provisions infrastructure (cloud APIs). Ansible configures OS/packages/apps (SSH). Often used together: Terraform creates VM, Ansible configures it.
12
How do you debug CrashLoopBackOff?
Kubernetes
Intermediate
▾
kubectl logs pod --previous, describe pod events, check probes, image pull, config mounts, and resource limits. Fix root cause then rollout restart.
13
Git merge vs rebase on feature branches.
Git
Intermediate
▾
Merge preserves history with merge commit. Rebase replays commits on updated base — linear history but rewrites SHAs; avoid rebasing shared branches.
14
What is an SRE error budget?
SRE
Intermediate
▾
Allowed unreliability derived from SLO. When budget exhausted, freeze features and focus on reliability work — balances velocity vs stability.
15
Nginx reverse proxy use case.
Nginx
Intermediate
▾
Terminate TLS, route by path/host to upstream app servers, add headers, rate limit, serve static files — single public entry point.
16
Secrets in CI/CD — best practice.
CI/CD
Intermediate
▾
Store in vault/GitHub Secrets/Vault; inject at runtime; never log; rotate regularly; least privilege per pipeline job.
17
Cloud shared responsibility model.
Cloud
Beginner
▾
Provider secures cloud (hypervisor, physical). Customer secures in-cloud (IAM, patching apps, data classification). Serverless shifts more to provider but not all.
18
Write a safe Bash loop over files.
Bash
Intermediate
▾
#!/usr/bin/env bash set -euo pipefail for f in "$@"; do [[ -f "$f" ]] || continue process "$f" doneUse quotes, set -euo pipefail, validate inputs.
19
Incident response first 15 minutes.
SRE
Advanced
▾
Acknowledge page, assign incident commander, mitigate user impact (rollback/scale/feature flag), preserve evidence, communicate status, document timeline for postmortem.
20
Design HA Kubernetes control plane.
Kubernetes
FAANG
▾
Multi-master etcd cluster (odd nodes), stacked or external etcd, LB for API server, spread across AZs, backup etcd, test disaster recovery quarterly.
21
Docker multi-stage builds — why?
Docker
Intermediate
▾
Compile in builder stage; copy only artifacts to slim runtime image — smaller attack surface, faster pulls, no compiler in prod image.
22
Helm chart vs raw YAML.
Helm
Intermediate
▾
Helm templatizes K8s manifests with values.yaml for env differences, release history, and rollback. Raw YAML fine for small static deployments.
23
How does Grafana alerting work?
Grafana
Intermediate
▾
Alert rules on panel queries → notification policies → contact points (Slack/PagerDuty). Unified alerting replaced legacy dashboard-only alerts in Grafana 8+.
24
AWS IAM role vs user.
AWS
Intermediate
▾
Users are long-lived identities with keys — avoid on servers. Roles are assumed temporarily (EC2 instance profile, Lambda execution role) — preferred for workloads.
25
Canary deployment in Kubernetes.
Kubernetes
Advanced
▾
Route small traffic % to new version via service mesh (Istio/Linkerd) or duplicate Deployment with weighted Service. Watch golden signals before full promotion.
26
What is MTTR vs MTBF?
SRE
Beginner
▾
MTTR: mean time to repair/recover. MTBF: mean time between failures. SRE focuses on reducing MTTR with runbooks, observability, and safe rollbacks.
27
Jenkins pipeline declarative vs scripted.
Jenkins
Intermediate
▾
Declarative: structured Jenkinsfile with stages/steps — easier validation. Scripted: Groovy freedom — powerful but harder to maintain. Prefer declarative for most teams.
28
Linux debug high CPU process.
Linux
Intermediate
▾
top/htop → identify PID → ps -p PID -o %cpu,cmd → strace -p PID or perf top for syscalls/hot functions.
29
Zero-downtime database migration strategy.
CI/CD
FAANG
▾
Expand-contract: add new column/table, dual-write, backfill, switch reads, stop old writes, remove old schema. Never rename/drop in one deploy without compatibility window.
No questions match this filter.