CI/CD · Ship safely, repeatedly
What are CI/CD best practices?
Short answer
Keep batches small, integrate into trunk frequently, build once and promote the same artifact, keep tests fast and deterministic, secure credentials, add meaningful gates, and verify every deployment with observability and a rollback path.
Good CI/CD is less about a particular tool and more about shortening the loop between a change and trustworthy feedback. The pipeline should make the safe path the easy path.
- Merge small changes frequently and keep the mainline releasable
- Build the artifact once and promote it by immutable reference
- Run fast deterministic checks first and expensive checks where they add value
- Treat secrets, permissions and untrusted code as first-class security concerns
- Use gates that measure real risk, not activity or vanity metrics
- Verify deployments with SLOs and business signals, and rehearse rollback
- Track DORA metrics and pipeline duration to find constraints
- Keep pipeline configuration reviewed, versioned and documented
stages:
- validate
- build
- test
- scan
- publish
- deploy
- verify
rules:
- fail fast on validation
- reuse the same artifact
- block on real risk
- verify after deployFollow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Which practice would you adopt first in a new team?
- 2How do you balance speed with safety?
- 3What does build once and promote mean in practice?
- 4How do you know the pipeline is improving?
Say it in the interview
The practices I care about most are small frequent integrations, building once and promoting the same artifact, and fast deterministic checks. I secure credentials and untrusted code, add gates that measure real risk, and verify deployments with SLOs and business signals. I also rehearse rollback and track DORA metrics to see where the system is constrained. The controls should match the risk of the product rather than being copied from a checklist.
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.