How do you promote a build through environments, and why does staging need to match production?
What they are really testing: Whether you promote the same artifact through dev/staging/prod gaining confidence, and understand that environment parity is what makes pre-prod testing meaningful.
A real interview question
How do you promote a build through environments, and why does staging need to match production?
What most people say
drag me
“You test in staging and then deploy to production if it works.”
It misses promoting the same artifact (not rebuilding) and, crucially, that staging must resemble production, if staging differs significantly, passing there tells you little. Parity is the point of the question.
The follow-ups they ask next
What happens when staging diverges significantly from production?
Tests passing in staging stop predicting prod behavior, you get works-in-staging-breaks-in-prod surprises. The pre-prod environment loses its value; parity (topology, data shape, config approach) is what makes staging meaningful.
What should differ between environments, and what should not?
Only configuration (endpoints, secrets, sizes) should differ, injected at deploy time. The artifact must stay identical across environments so the thing you tested is the thing you ship.
What the interviewer is listening for
- Promotes the same artifact, not rebuild
- Each env adds validation
- Insists on staging/prod parity, only config differs
What sinks the answer
- Rebuilds per environment
- No parity awareness
- Treats staging as a formality
If you genuinely do not know
Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.
“Promote [the same immutable artifact through dev -> staging -> prod, gaining confidence, not rebuilding]. [Each environment adds validation, fast checks low, fuller integration/perf high]. Staging must [mirror production (topology, data shape, config approach)] or [passing there does not predict prod, works-in-staging-breaks-in-prod]. [Only config differs between environments; the artifact stays identical].”
Keep going with deployment
Foundation
What do CI and CD actually mean, and what is the difference between continuous delivery and continuous deployment?
Foundation
Why should you build an artifact once and promote the same one through environments?
Junior
What stages should a good CI/CD pipeline have?
Junior
A deploy went bad in production. How do you handle rollback, and how do you make rollback easy?
Junior
What are feature flags, and how do they decouple deployment from release?
Mid
Compare blue-green and canary deployments. When would you reach for each?
Knowing the answer is not the same as recalling it under pressure
Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.
Start free