Model answers for 4 DevOps questions
Typical round: concepts, pipeline walkthrough, troubleshooting scenario
Q: Walk me through your CI/CD pipeline. A: On every pull request, GitHub Actions runs lint, unit tests and a Docker build. On merge to main, it pushes the image to ECR, runs Terraform plan and apply for infra changes, and deploys to staging with Helm. Production deploys are manual approvals with a canary rollout and automatic rollback on error-rate alarms.
Q: How do you make Docker images smaller and safer? A: Use multi-stage builds, a slim or distroless base, copy only what's needed, run as a non-root user, pin versions, and scan images in CI for vulnerabilities.
Q: A pod is in CrashLoopBackOff. How do you debug it? A: kubectl describe pod for events, kubectl logs --previous for the crashed container's output, then check config and secrets, resource limits (OOMKilled), liveness probe settings and the image tag.
Q: What is the difference between blue-green and canary deployments? A: Blue-green switches all traffic from the old to a full new environment at once, with quick rollback. Canary shifts a small percentage of traffic first and increases it as metrics stay healthy.