Stream LLM Output While Committing Reliable DAG Results

Read the full interview experience this question came from →

Quick Overview

Stream provisional LLM output to clients while durably validating and committing complete structured results before downstream DAG tasks execute.

Stream LLM Output While Committing Reliable DAG Results

Company: Qualified Health

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

A workflow runs an LLM task whose output must appear incrementally in an interactive client. Downstream DAG nodes, however, require the complete structured result before they can run. Design a path that provides responsive token streaming while committing the final result reliably and unblocking downstream work only when that result is complete and valid. ### Constraints & Assumptions - Client-visible partial text is not equivalent to a committed task result. - A client can disconnect and reconnect while generation continues. - Generation may fail or produce an invalid structured result after partial text has already been displayed. - The source supplies no exact replay-retention, latency, or output-format requirements; identify those decisions explicitly. ### Clarifying Questions to Ask - Must a reconnecting client replay every fragment, or is receiving the latest snapshot sufficient? - Which schema or validation rule makes the final result usable by downstream tasks? - Can generation continue without a connected client, and what cancellation policy applies? - Must provisional output be durable, or only the final artifact and task outcome? ```hint Identify the commit signal Receiving the last visible token is not necessarily the same event as validating and durably storing the result required by the next DAG node. ``` ### What a Strong Answer Covers - Separate provisional streaming and durable completion semantics. - Run, task, attempt, and sequence identity for replay and duplicate handling. - A final artifact commit and readiness transition that cannot be inferred from a client's connection closing. - Bounded buffering, slow-client handling, invalid output, and retry visibility. ### Follow-up Questions - What should the UI show if a retry replaces a failed attempt that already streamed text? - How can reconnecting clients distinguish missing fragments from a new attempt? - Why should a slow browser not hold the task's completion transaction open?

Overview: Stream provisional LLM output to clients while durably validating and committing complete structured results before downstream DAG tasks execute.

Read the full Qualified Health Software Engineer interview experience this question came from

|Home/System Design/Qualified Health
Qualified Health logo
Qualified Health
Sep 30, 2026
hardSoftware EngineerOnsiteSystem Design
0
0

A workflow runs an LLM task whose output must appear incrementally in an interactive client. Downstream DAG nodes, however, require the complete structured result before they can run.

Design a path that provides responsive token streaming while committing the final result reliably and unblocking downstream work only when that result is complete and valid.

Constraints & Assumptions

  • Client-visible partial text is not equivalent to a committed task result.
  • A client can disconnect and reconnect while generation continues.
  • Generation may fail or produce an invalid structured result after partial text has already been displayed.
  • The source supplies no exact replay-retention, latency, or output-format requirements; identify those decisions explicitly.

Clarifying Questions to Ask Guidance

  • Must a reconnecting client replay every fragment, or is receiving the latest snapshot sufficient?
  • Which schema or validation rule makes the final result usable by downstream tasks?
  • Can generation continue without a connected client, and what cancellation policy applies?
  • Must provisional output be durable, or only the final artifact and task outcome?

What a Strong Answer Covers Guidance

  • Separate provisional streaming and durable completion semantics.
  • Run, task, attempt, and sequence identity for replay and duplicate handling.
  • A final artifact commit and readiness transition that cannot be inferred from a client's connection closing.
  • Bounded buffering, slow-client handling, invalid output, and retry visibility.

Follow-up Questions Guidance

  • What should the UI show if a retry replaces a failed attempt that already streamed text?
  • How can reconnecting clients distinguish missing fragments from a new attempt?
  • Why should a slow browser not hold the task's completion transaction open?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...