Why should the same build artifact be promoted through environments instead of rebuilding for each one?
What they are really testing: Whether you understand that a rebuild breaks the entire logic of testing. This is a favourite because it sounds pedantic but exposes whether someone has actually thought about what a passing test proves.
A real interview question
Why should the same build artifact be promoted through environments instead of rebuilding for each one?
What most people say
drag me
“It is faster because you do not have to build the same thing three times.”
Speed is a side effect. The candidate misses the correctness argument entirely, which means they would happily approve a pipeline that rebuilds per environment and silently invalidates its own testing.
The follow-ups they ask next
What has to be true about your app for that to work?
Config has to be external, so environment variables, mounted config, or a secrets manager, never compiled in. That is the 12-factor config principle.
How do you make sure the artifact you deploy really is the one you tested?
Immutable tags by commit sha rather than mutable tags like latest, and ideally digest pinning plus artifact signing so the pipeline can verify provenance before deploy.
What the interviewer is listening for
- Leads with the correctness argument
- Gives a concrete way builds can differ
- Knows config must be externalised
What sinks the answer
- Only cites build time
- Comfortable with per-environment builds
- Uses mutable tags like latest for deploys
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.
“Because [a green test proves that specific artifact works, not the source]. Rebuilding means [you ship something you never tested], since [dependencies or base images can move]. So [build once, tag by commit sha, promote the same artifact] and [inject config at runtime].”
Keep going with ci/cd
Foundation
What is the difference between continuous integration, continuous delivery, and continuous deployment?
Junior
Design the pipeline for a typical web application. What stages would you have, and in what order?
Mid
Our pipeline takes 45 minutes and developers have stopped waiting for it. How do you fix that?
Mid
A test fails about 1 in 5 runs. The team wants to add an automatic retry. What is your view?
Senior
You inherit 200 Jenkins jobs with no documentation and are asked to migrate to a modern CI system. How do you approach it?
Foundation
What is a container, and how is it different from a virtual machine?
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