Choose a Transport for Streaming Agent Logs to the Browser

Last updated: November 29, 2026

Quick Overview

Replit Agent streams its plan, tool calls, and command output to the workspace while it works. Compare WebSockets, Server-Sent Events, and long polling for this stream and pick one, explaining reconnection and ordering.

Replit
Software Engineering Fundamentals
Frontend Engineer
Replit
November 29, 2026
Frontend Engineer
Phone Screen
Software Engineering Fundamentals
Easy

0

0

0 solved


Replit Agent streams its plan, tool calls, and command output to the workspace while it works. Compare WebSockets, Server-Sent Events, and long polling for this stream and pick one, explaining reconnection and ordering.

Frontend and product engineers at Replit spend a lot of time on live, streaming UI: the console, the Agent feed, and deployment logs. The interviewer checks that you know the real differences between these transports and design for dropped connections instead of the happy path.

What the Interviewer Expects
  • States directionality: SSE is server to client, WebSockets are bidirectional
  • Mentions SSE's built-in reconnect and Last-Event-ID resume
  • Discusses proxies, HTTP/2 multiplexing, and connection limits
  • Designs ordering with sequence numbers and idempotent rendering
  • Picks one with a reason tied to the Agent use case
Key Topics to Cover
WebSockets
Server-Sent Events
reconnection
event ordering
streaming UI
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • The user also needs to interrupt the Agent mid-run. Does that change your choice?
  • How would you render 10,000 log lines without jank?
  • How do you resume after the laptop sleeps for an hour?
  • How would you test the reconnect path?
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

Mostly server-to-client events (plan steps, file edits, shell output), occasional client actions (stop, approve), must survive network blips and tab sleeps, and must not duplicate or reorder events in...

High-Level Design

Long polling works everywhere but adds latency and request overhead per batch. SSE is plain HTTP, text only, one direction, with automatic reconnect and a Last-Event-ID header so the server ...


Submit Your Answer
Markdown supported

Related Questions