AI Application Integration · 90 minutes
Stream, stop, and replace a response
Explain how a streaming feedback UI shows partial output, what Stop really cancels, and how run IDs keep late events from an old attempt out of a new answer.
1.5 h
Used in interview rounds:
Technical Screen (Easy)1
Step 1: The question
Using the feedback session, explain what the browser and the backend each own, then walk through steps 1 to 7: what the UI shows for R1 and R2, and what the client does at each step. Say what Stop does and does not cancel, how the late R1 event is kept out of R2, and how the UI announces state changes to screen-reader and keyboard users.
Make state visible
| State | User meaning | Typical control |
|---|---|---|
| Idle | Ready for a request | Send |
| Submitting | Request is being accepted | Prevent accidental duplicate submission |
| Streaming | Partial response is arriving | Stop |
| Complete | Server confirmed completion | Copy, review, or continue |
| Interrupted | Response ended without completion | Reconnect or retry |
| Cancelled locally | User stopped this client operation | Start a new attempt if desired |
| Failed | A defined error prevents continuation | Explain and offer a suitable next action |
Keep partial text when it helps the user, but label it accurately. Do not display a completed checkmark simply because some text arrived.
Scenario: the feedback session
Suppose a fictional coding-practice platform has an interview-practice assistant: a learner types an answer to an interview question, and the assistant streams written feedback into a chat thread.
How the platform works
- The browser talks only to the platform's backend. The backend calls a model provider and saves every run.
- Each submission starts a new run with its own ID (R1, R2, and so on). Every stream event the client receives carries the run ID it belongs to.
- Stream events are
delta(more feedback text),done(the backend finished and saved the full feedback), anderror(the run failed, with a message). POST /feedback-runs/{runId}/cancelasks the backend to stop a run.GET /feedback-runs/{runId}returns the run's saved status (running,completed,cancelled, orfailed) and, when it iscompleted, the full feedback text.- The backend cannot resume a broken stream from the middle.
- The assistant has no side-effecting tools.
Timeline
| Step | What happens |
|---|---|
| 1 | The learner submits answer A. The backend accepts it as run R1, and R1's feedback starts streaming. |
| 2 | After two paragraphs of R1 feedback, the learner presses Stop. |
| 3 | The learner submits a revised answer B. The backend accepts it as run R2, and R2's feedback starts streaming. |
| 4 | A delayed R1 delta event, already in flight when the learner pressed Stop, reaches the client's event handler. |
| 5 | The response to R1's cancel request says R1 is already completed, with its full feedback saved. |
| 6 | After three paragraphs of R2 feedback, R2's connection drops. No done or error event arrived for R2. |
| 7 | R2's saved status on the backend is completed, with its full feedback saved. |
Constraints
- Use only the platform facts and timeline in the scenario
- Keep the answer to about three minutes spoken
Deliverables
- What the browser owns and what the backend must enforce
- How the client reads the stream and decides a run is complete
- What Stop does at step 2, and what it does not guarantee
- How R1's late event and later status stay out of R2
- Labels, announcements, focus, and scrolling during the session
2
Step 2: Hints
Optional. Each hint gives a little more away.
3
Step 3: Your answer
Kept in this browser. Saving your score below keeps a copy with it.
0 / 5000
4
Step 4: Reference answer
5
Step 5: Score yourself
Score each dimension 0, 1, or 2, then save the score to your history. Readiness thresholds are editorial estimates.
Grades your written answer against this rubric with your own AI provider key from Settings. It is a second opinion: the score you save is still yours.
0 of 10 · Scored 0 of 5 dimensions
Ready at 8 of 10, with no 0 in Streaming semantics
Kept in this browser until you sign up, then it moves to your account.
Complete this level when you can walk through all seven steps of the feedback session, naming each run's state and the client's action, without confusing connection state with task completion.
Your saved scores
Practice saves and mock interview answers on this question, newest first.
No saved scores yet. Score every dimension, then save.
6
Step 6: Follow-up questions
An interviewer may ask these next.
Is a network chunk a token?
Does the end of a stream (EOF) mean success?
What does Stop cancel?
Why track run IDs?
Why avoid token-by-token announcements?
7
