All jobs / Backend developer / Security
Backend developer interview question · 5+ years
The interviewer asks: “A popular npm/NuGet/Maven package you use was compromised. What should already have been true?” Strongest answer?
The strongest answer
Pinned, reviewed dependencies, lockfiles in CI, scanning, and minimal install surface. We can freeze and roll back. We don't float latest on main, and we don't run postinstall scripts from untrusted tags.
Why it works
Exactly. Supply chain is a backend production risk. Pin + scan + a rollback story is the mature bar. Rebuilds should be reproducible.
What a good answer covers
- Lockfiles, pins, scans, rollback.
- Don't float latest on main.
- The registry can lie; hashes shouldn't.
- No ad-hoc curl | sh in prod.
Answers that fall short
- Close, but not the strongest: We always take latest so we get security patches fastest.
Floating latest is how you ingest the compromise automatically. Patches come through reviewed bumps. - Weak: Vendoring isn't worth it; the registry is the source of truth.
The registry being “truth” is the problem when the registry serves malice. Lockfiles and hashes are your truth. - Red flag: I'll curl | sh the hotfix the maintainer tweeted.
curl | sh from a social post is how you widen the blast. Use the same reviewed pipeline.
Who gets asked this
More Security questions
- The interviewer asks: “Product wants to keep clickstreams forever for “future ML.” What's your backend…
- The interviewer asks: “Where do database passwords and API keys live?” Strongest answer?
- The interviewer asks: “How do you put user input into SQL?” Strongest answer?
- The interviewer asks: “We set CORS to our frontend origin. Are we safe?” Strongest answer?
- The interviewer asks: “How do services get secrets in production?” Strongest answer?
- 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?