CI/CD · Ship safely, repeatedly
What environment strategy should a delivery pipeline use?
Short answer
Use ephemeral preview environments for pull requests, a stable staging environment for integrated checks, and production. Promote the same artifact through them and keep environment-specific configuration outside the artifact.
Environments exist to answer different questions. A preview environment answers whether a change works in isolation. Staging answers whether the integrated system works. Production answers whether real users and real data are healthy.
- Preview environments per pull request give reviewers a live target and are destroyed after merge
- Staging should resemble production in architecture and configuration shape, with synthetic data
- Production is the only environment with real customer data and real traffic
- Configuration and secrets are injected per environment, never baked into the artifact
- Environment drift should be detected and corrected through infrastructure as code
environments:
preview:
ttl_hours: 48
data: synthetic
staging:
data: synthetic
scale: small
production:
data: real
scale: fullFollow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1What is a preview environment and when is it worth the cost?
- 2How do you keep staging close to production?
- 3Where should environment-specific configuration live?
- 4How do you handle data in non-production environments?
Say it in the interview
I use ephemeral preview environments for pull requests, a shared staging environment for integrated checks, and production. The same artifact is promoted through each, with configuration injected at deploy time. Staging mirrors production in architecture but uses synthetic data and smaller scale. I watch for drift and manage environments through infrastructure as code so they do not become snowflakes.
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.