All jobs / Backend developer / Deployment Basics
Backend developer interview question · 0–1 years
The interviewer asks: “How do you log from a service in production?” Strongest answer?
The strongest answer
A logger with levels, a request id, and no secrets in the message. Console.log / print is for a local experiment, not the traffic path.
Why it works
Exactly. Structured logs + correlation id beat a wall of prints. Levels let you turn debug on without shipping secrets.
What a good answer covers
- Logger, levels, request id.
- Stdout is the sink; structure is the format.
- Don't log bodies or secrets.
- print is not production observability.
Answers that fall short
- Close, but not the strongest: Log to stdout and let the platform collect it — that's enough.
Stdout is the right sink — still use a logger so level, shape and redaction exist. “Enough” without a request id is a pile of lines. - Weak: Print every request body so I can debug anything later.
Bodies contain tokens, PII and card data. Debug one request with a flag; don't journal everyone forever. - Red flag: Log passwords and Authorization headers at info so support can replay logins.
Auth material in logs is a credential dump. Support gets a replay tool, not the password file.
Who gets asked this
More Deployment Basics questions
- The interviewer asks: “Liveness versus readiness — what do you expose?” Strongest answer?
- The interviewer asks: “A user says checkout failed at 16:02. How do you find it in logs?” Strongest answer?
- The interviewer asks: “How do you observe a production service?” Strongest answer?
- The interviewer asks: “A request touches four services. How do you see the whole path?” Strongest answer?
- The interviewer asks: “Kubernetes sent SIGTERM. What does your process do?” Strongest answer?
- 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?”…