All jobs / Backend developer / Security
Backend developer interview question · 3–5 years
The interviewer asks: “How do services get secrets in production?” Strongest answer?
The strongest answer
A secret manager (cloud KMS/vault) mounted or injected at runtime, short-lived where possible, rotated without a code change. Not files in the image, not git, not a shared Slack message.
Why it works
Exactly. Identity of the workload fetches the secret. Rotation doesn't need a rebuild. Audit who read what.
What a good answer covers
- Runtime inject from a secret manager.
- Short-lived, rotatable, audited.
- Not git, not images, not logs.
- Workload identity beats a shared password.
Answers that fall short
- Close, but not the strongest: Encrypted secrets.yaml in the repo — we have the key in CI.
A repo plus a CI key is still a secret in version control, copied onto every laptop that can decrypt. Vaults exist for this. - Weak: One long-lived secret baked into the AMI.
AMI-baked secrets are immortal and shared by every instance of that image. Rotate means baking again — you won't. - Red flag: Print the secret at startup so the orchestrator can scrape it from logs.
Logs are copied, indexed and retained. Printing secrets is a leak by design.
Who gets asked this
More Security questions
- The interviewer asks: “What must never land in logs or traces?” Strongest answer?
- The interviewer asks: “A user asks us to delete their data. What does a backend actually do?” Strongest…
- The interviewer asks: “Threat-model this order service. Where do you start?” Strongest answer?
- The interviewer asks: “A customer requires their data stay in the EU. What do you actually implement?”…
- The interviewer asks: “The API pod's cloud role can read all buckets and impersonate other roles. What's…
- The interviewer asks: “Privacy by design — what does the backend actually ship?” Strongest answer?
- The interviewer asks: “A popular npm/NuGet/Maven package you use was compromised. What should already have…
- The interviewer asks: “Product wants to keep clickstreams forever for “future ML.” What's your backend…