DevOps Engineer Interview Questions & Answers

DevOps interviews test infrastructure automation, CI/CD expertise, and troubleshooting skills. These questions cover the most common topics in DevOps and SRE interviews.

Explain the difference between Docker and Kubernetes. When would you use each?

Docker is a containerization platform — it packages applications into portable containers. Kubernetes is a container orchestration platform — it manages, scales, and deploys containers across a cluster. Use Docker for containerizing applications. Use Kubernetes when you need to run multiple containers at scale with auto-scaling, load balancing, and self-healing.

Design a CI/CD pipeline for a microservices application.

Trigger: PR/push to branch. Steps: 1) Lint + static analysis, 2) Unit tests, 3) Build Docker image, 4) Push to container registry, 5) Deploy to staging (Kubernetes), 6) Integration/E2E tests, 7) Manual approval gate, 8) Production deploy (blue-green or canary), 9) Smoke tests, 10) Monitoring alerts. Discuss rollback strategy.

How would you handle a production incident at 3 AM?

Incident response framework: 1) Acknowledge and assess severity, 2) Check monitoring dashboards (Grafana, Datadog), 3) Check recent deployments (rollback if related), 4) Check infrastructure (cloud provider status, resource utilization), 5) Mitigate first, root-cause later, 6) Communicate status updates, 7) Post-mortem within 48 hours with action items.

What is Infrastructure as Code and why is it important?

IaC treats infrastructure configuration as version-controlled code (Terraform, CloudFormation, Pulumi). Benefits: reproducibility (same infrastructure in dev/staging/prod), auditability (git history), scalability (spin up environments quickly), disaster recovery (rebuild from code). Explain your experience with specific IaC tools.

How do you set up monitoring and alerting for a production system?

Four pillars: metrics (Prometheus/CloudWatch for CPU, memory, request rates), logs (ELK/CloudWatch Logs for error tracking), traces (Jaeger/X-Ray for request flow), and alerts (PagerDuty for on-call). Set SLOs and alert on SLI violations. Avoid alert fatigue by tuning thresholds and using severity levels.