CS FundamentalsModerateProduct-company DevOps interview
According to the Twelve-Factor App methodology, where should a service keep its database URL and API keys that differ between staging and production?
- A. In a config file committed to the repository, one per environment
- B. Hard-coded constants selected by a build flag
- C. Inside the Docker image
- D. In environment variables (or a secrets store exposed through them), strictly separated from code
Correct answer: D. In environment variables (or a secrets store exposed through them), strictly separated from code
Factor III says config that varies between deploys belongs in the environment, not the code; a test is whether the code could be open-sourced right now without leaking credentials.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A CI pipeline takes 40 minutes: end-to-end UI tests (30 min) run first, then unit tests (3 min), then linting (1 min). Most failures are…
- A service's SLO is 99.9% of requests succeeding over a 30-day window. For a downtime-based view, what is the monthly error budget in…
- A service has a 99.9% success SLO over 30 days. An incident causes a steady 0.5% error rate. If it continues, how soon will the whole…
- A Kubernetes HorizontalPodAutoscaler targets 60% average CPU. There are 4 pods averaging 90% CPU. The HPA uses desired = ceil(current…
- A VM costs ₹10 an hour on demand. A one-year reserved commitment for the same VM costs ₹52,560, payable whatever the usage. Above what…
- A client calls a payment API with exponential backoff: wait 100 ms before the first retry and double the wait each time, for up to 4…