Design Distributed Tracing Across Checkout Microservices

Last updated: November 29, 2026

Quick Overview

Design an X-Ray style tracing system that follows a single checkout request through dozens of services (cart, pricing, tax, payments, fraud, inventory) and lets engineers find which hop made it slow or failed.

Amazon
System Design
Software Engineer
Amazon
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design an X-Ray style tracing system that follows a single checkout request through dozens of services (cart, pricing, tax, payments, fraud, inventory) and lets engineers find which hop made it slow or failed.

A senior observability prompt in Amazon's service-oriented style, where a checkout touches many teams' services. Interviewers check context propagation, sampling strategy, and how traces are stored and queried without the tracing system costing more than the services it watches.

What the Interviewer Expects
  • Propagate a trace ID and parent span ID across HTTP, queues and async work
  • Choose head-based and tail-based sampling and explain their costs
  • Collect spans through a local agent with batching
  • Store spans by trace ID and build indexes for search by service, latency and error
  • Build a service map from aggregated span data
Key Topics to Cover
Context propagation
Sampling
Span storage
Tail-based sampling
Service maps
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How would you make sure every slow or failed trace is kept when you sample 1 percent?
  • How do you trace through an SQS queue where the consumer runs minutes later?
  • What happens to the application if the tracing agent is down?
  • How would you handle clock skew between hosts when drawing a timeline?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: every request gets a trace ID at the edge; each service records spans (start, duration, status, annotations). Engineers can fetch a trace by ID, search traces (service = payments, late...

High-Level Design
  1. SDK in each service: creates spans, propagates trace_id, parent_span_id and a sampling flag in headers and in message attributes for queues.
  2. Local agent (daemon) on each host receive...

Submit Your Answer
Markdown supported