CI/CD · Ship safely, repeatedly
What are the typical stages of a CI/CD pipeline?
Short answer
A typical pipeline validates source, builds, runs tests, scans for security issues, packages a versioned artifact, deploys it, and verifies the result. Stages should fail fast and pass artifacts forward rather than rebuilding.
Stages exist to give fast feedback and to separate concerns. Cheap checks such as linting and unit tests should run before expensive integration or end-to-end suites, so a typo does not consume a fleet of runners.
- Validate: checkout, dependency install, lint, type checks and commit conventions
- Build: compile and produce a versioned artifact or container image
- Test: unit, integration and contract tests, with end-to-end tests for critical journeys
- Scan: dependency, container, secret and static analysis checks
- Package and publish: push the immutable artifact to a registry
- Deploy and verify: promote to an environment, run smoke tests and watch health signals
stages:
- validate
- build
- test
- scan
- publish
- deploy
- verifyFollow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Which stage should run first and why?
- 2Where do security scans belong?
- 3Should deployment and verification be separate stages?
- 4How do you avoid rebuilding the artifact between stages?
Say it in the interview
I structure pipelines so cheap validation runs first, then build, test and security scans, then publishing an immutable artifact. Deployment and post-deploy verification come last. The important part is that stages pass the same artifact forward instead of rebuilding, and that a failure stops promotion. I adapt the list to the product rather than treating a standard template as mandatory.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live CI/CD mock interview and get scored feedback on depth, clarity and confidence.