Walk me through the stages of a typical CI/CD pipeline you would build for a web service.
What the interviewer wants to hear
- Trigger on commit or pull request
- Build, lint and unit tests
- Security scans and artifact or image creation
- Deploy to staging and run integration tests
- Production deploy with approval or progressive rollout and rollback
Model answer
The pipeline starts when someone opens a pull request or pushes a commit. First it checks out code, restores the dependency cache, then runs linting and unit tests so developers get feedback in a few minutes. Next it builds a versioned artifact, usually a container image tagged with the commit SHA, and runs security checks such as dependency and image scanning. After merging to main, the same image is pushed to the registry and deployed to a staging environment, where integration and smoke tests run. Production deployment uses the exact same image, either after a manual approval or automatically with a canary or rolling update. Health checks and metrics decide whether to continue, and if something goes wrong the pipeline can roll back to the previous version quickly.
Can you answer it under time pressure?
Take a timed easy round and get scored on every answer.
More easy DevOps Engineer questions
- What does DevOps mean to you, and how is it different from a traditional operations team?
- How is a container different from a virtual machine? When would you choose one over the other?
- What is Infrastructure as Code and why is it better than creating resources by clicking in the cloud console?
- Explain how a Deployment, a Service and an Ingress work together to expose a web app in Kubernetes.
- Compare trunk-based development with GitFlow. Which would you choose for a team that deploys several times a day, and why?
- Walk me through what happens when you run docker run -p 8080:80 nginx:1.27 on a fresh machine.
- What is the difference between monitoring and observability, and what are the main signals you would collect for a web service?
- How does a load balancer use health checks, and what makes a good health check endpoint?
- Terraform and Ansible are both called infrastructure as code. How do they differ, and when would you use each?