Product asks for a feature-flag check inside a deployment script. How do you keep the script from becoming fragile?
BeginnerScenarioTesting, CI/CD, packaging & services
Answer
Situation read → External dependency in the deploy path.
What I'd do →
- Wrap the flag service call in a small client with a timeout and a safe default (fail closed or open, decided explicitly).
- Cache the flag value for the duration of the run.
- Log the decision and the flag value.
- Unit-test both branches with a mocked client.
Why → Deploys must not hang or break because a non-critical service is slow.
Interview tip → Explicitly choosing fail-open vs fail-closed is what interviewers look for.
More on Testing, CI/CD, packaging & services
You join a team whose Python automation repo has no tests. Where do you start?BeginnerYour pytest suite takes 12 minutes. How do you speed it up?IntermediateA test passes locally but fails in CI only when run with the rest of the suite. What do you suspect?IntermediateYou want a reusable CI pipeline for 15 Python tool repos. What goes in it?IntermediateYour Python Docker image is 1.1 GB. How do you shrink it?IntermediateYou want to distribute an internal CLI to 200 engineers. What are your options?Intermediate