What is distributed tracing, and how does it work?
What they are really testing: Whether you understand traces, spans, and context propagation, and why tracing is the pillar that makes distributed latency debuggable. Also sampling for cost.
A real interview question
What is distributed tracing, and how does it work?
What most people say
drag me
“Tracing follows a request through your system to see what it does.”
Directionally right but missing the mechanics: spans, parent-child structure, and especially context propagation via headers, which is what makes a trace span multiple services. Without that you cannot explain how it works.
The follow-ups they ask next
How does a trace span multiple services?
Context propagation: the trace ID and span ID are passed across service boundaries (typically via HTTP headers like traceparent), so each service attaches its spans to the same trace, reconstructing the full path.
Why and how do you sample traces?
Tracing every request is expensive at scale. Sampling (head-based at the start, or tail-based keeping slow/errored traces) reduces volume and cost while still capturing representative and interesting traces.
What the interviewer is listening for
- Trace=one request, spans=operations with parent-child
- Explains context propagation via headers
- Knows tracing for distributed latency + sampling
What sinks the answer
- Vague "follows a request"
- No notion of spans or propagation
- Unaware of sampling/cost
If you genuinely do not know
Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.
“A trace is [one request end to end], made of [spans, each a timed operation, in a parent-child tree]. It spans services via [context propagation: a trace ID/span ID passed in headers, so each service attaches spans to the same trace]. It shows [where time goes across services, the bottleneck span], which metrics/logs cannot. Use [sampling] for cost.”
Keep going with observability
Foundation
What is the difference between monitoring and observability?
Foundation
What are the three pillars of observability, and what is each good for?
Foundation
What should you measure first for a service? Explain the golden signals (or RED/USE).
Junior
What are good logging practices for a distributed system?
Junior
What are the main metric types (counter, gauge, histogram), and when do you use each?
Junior
How does Prometheus collect metrics, and what is the pull model?
Knowing the answer is not the same as recalling it under pressure
Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.
Start free