A large log viewer is an ordered investigation window, not a text area that keeps appending. The browser owns a bounded projection of one query generation. It merges historical pages with a resumable live cursor, rejects duplicates and stale events, exposes gaps, virtualizes the visible rows, and separates pause of presentation from pause of receipt and transport.
A production log surface may cover millions of stored events while receiving thousands more each second. The user expects to search, jump through time, expand a multiline record, select a row, copy safe fields, scroll away from the tail, and return without losing their place. Those interactions compete with an input stream that can outrun the main thread.
The browser should coordinate committed query state, ordered page merge, stream generations, bounded buffers, virtualized rendering, selection, search scope, and recovery status. The service should authorize every query, constrain cost, issue cursors, replay gaps, redact protected data, and keep the durable result.
Clarify the log investigation
Ask which query language and data sources are supported, whether order is ascending or descending, whether event IDs and sequence numbers exist, how long cursors remain valid, what Pause means, how much client memory is safe, whether multiline expansion changes row height, which fields can be copied or exported, and whether the reader needs a screen-reader review mode.
For this design, assume an authenticated operations tool. A committed query can load older history, move into live tail, pause presentation, resume from a bounded buffer or server cursor, expand structured details, and share a safe investigation link. Desktop is the primary investigation surface. Mobile supports bounded reading, filtering, selection, and pause or resume.
Building the log store, implementing the query language, and promising unlimited browser retention are outside scope.
The public interview prompt
Design a log viewer that can investigate millions of stored events and tail new events in real time. Explain:
- draft and committed queries, generations, ranges, sort direction, and shareable state;
- cursor pagination, stable event identity, overlap, deduplication, ordering, and gap recovery;
- WebSocket or streaming transport, batching, backpressure, bounded queues, and overload policy;
- distinct freeze-view, buffer-receipt, and stop-transport behaviors;
- virtualized variable-height rows, scroll anchoring, row expansion, selection, and keyboard focus;
- server search versus local highlight, structured fields, context lines, copy, and export;
- loading, no-match, partial, stale, reconnecting, overflow, and authorization states;
- redaction, tenant isolation, log injection, accessibility, performance, observability, and testing.
What the premium solution covers
The complete solution defines the ordered timeline invariant, historical and live protocols, a bounded backpressure model, three precise pause contracts, variable-height virtualization, query and local-search boundaries, safe structured rendering, accessibility, security, observability, testing, and rollout.
Original media follows a paused stream through bounded buffering and cursor recovery, compares the three meanings of Pause, maps historical pages to the live seam, and shows a virtualized log surface with a pinned selection. Two deterministic labs let the reader size a buffer and exercise duplicate, stale, gap, replay, pause, and resume events.