A trustworthy trace viewer does not draw whatever spans happened to arrive and call it a tree. It keeps one stable identity for each span across topology, timing, details, filters, and correlated evidence. Missing parents, sampling gaps, clock uncertainty, and late telemetry stay visible as evidence quality, not hidden as rendering cleanup.
A distributed trace can contain a handful of spans or tens of thousands. It can arrive as a complete lookup, a partial snapshot, or a snapshot followed by late patches. The same trace must work as a nested outline, a time waterfall, a searchable evidence set, and a launch point into logs and metrics.
The browser should own the current trace revision, normalized span entities, expansion, filtering, selection, virtualized projection, timing viewport, and inspector state. The service should own authorization, trace lookup and search, normalization, redaction, sampling metadata, durable retention, and permission-checked correlation links.
Clarify the investigation contract
Ask whether the product starts from a trace ID or a search result, whether traces can receive late spans, how partial traces are marked, whether clock-quality metadata exists, how many spans a trace may contain, which attributes are sensitive, and whether critical-path analysis is guaranteed or only estimated.
For this design, assume an authenticated observability product. A trace lookup returns a revisioned snapshot and may later return patches. Span and trace IDs are stable. Desktop is the primary analysis surface. Mobile supports search, outline navigation, selection, and details, but not every dense comparison mode.
Building the collector, implementing a query language, repairing service clocks, or inventing missing telemetry is outside scope.
The public interview prompt
Design a distributed trace viewer that supports small and very large traces. Explain:
- trace lookup, search, revisions, partial results, sampling, and late spans;
- normalized span identity, parent-child topology, orphan and cycle handling;
- hierarchy depth, start time, duration, overlap, clock skew, and critical-path uncertainty;
- expansion, selection, contextual filtering, waterfall zoom, and synchronized scrolling;
- row and bar virtualization, worker boundaries, attribute budgets, and mobile fallback;
- events, links, logs, metrics, errors, and permission-checked correlation;
- loading, missing, stale, partial, malformed, and unsupported states;
- keyboard behavior, screen-reader alternatives, privacy, observability, testing, and rollout.
What the premium solution covers
The complete solution builds one trace from normalized evidence without erasing uncertainty. It defines revision guards, orphan handling, the two-coordinate waterfall model, safe late-span merge, contextual filtering, large-trace virtualization, critical-path limits, correlation contracts, accessibility, security, observability, tests, and an evolution path.
Original media shows a missing parent arriving without moving the selected span, separates hierarchy from elapsed time, contrasts long work with causal latency, and maps one span through outline, waterfall, and inspector. Two deterministic labs let the reader assemble an out-of-order trace and test context-preserving filters under a DOM budget.