All jobs / Backend developer / Deployment Basics
Backend developer interview question · 3–5 years
The interviewer asks: “Kubernetes sent SIGTERM. What does your process do?” Strongest answer?
The strongest answer
Fail readiness immediately, drain in-flight requests within the terminationGracePeriod, close the listener, then exit 0. I don't die mid-write and I don't ignore the signal.
Why it works
Exactly. That's graceful shutdown: stop new traffic, finish old, then go. Pair it with a ready probe that already flipped.
What a good answer covers
- SIGTERM → not ready, then drain.
- Finish in-flight work; stop accepting new.
- Exit cleanly before SIGKILL.
- Don't crash and don't ignore the signal.
Answers that fall short
- Close, but not the strongest: Crash as soon as I get SIGTERM so the new pod can start.
Instant crash drops in-flight requests as 502s. That's the opposite of zero-downtime deploys. - Weak: Ignore SIGTERM; the container will be hard-killed anyway.
Ignoring SIGTERM means a SIGKILL in the middle of a transaction. You'll see partial writes and client errors. - Red flag: Keep taking new work until the last second so we don't waste capacity.
Taking new work after SIGTERM is how you get killed anyway, with more incomplete requests.
Who gets asked this
More Deployment Basics questions
- The interviewer asks: “We want 99.9% availability. What does that change in the team?” Strongest answer?
- The interviewer asks: “Production is down. Who does what in the first fifteen minutes?” Strongest answer?
- The interviewer asks: “A new ranking feature is burning CPU in production. What do you want already built?”…
- The interviewer (as hiring manager) asks: “How do you interview for on-call readiness?” Strongest answer?
- The interviewer asks: “The last outage was fixed by one person who “just knew.” What do you change?”…
- The interviewer asks: “How do you know failover works?” Strongest answer?
- What is the difference between a region and an availability zone?
- IaaS, PaaS, SaaS — what does each one leave to you?