The interview problem

Practice prompt

A customer’s AI response arrives all at once after twenty seconds, although direct access streams smoothly. Investigate the proxy path and propose a measurable fix.

Original practice, not a reported company interview. All worked numbers are illustrative. Interview date: not applicable. Written October 3, 2026.

1. Scope and assumptions

Confirm whether the endpoint uses SSE, another HTTP stream or WebSocket. A long request timeout does not guarantee incremental delivery. Use synthetic non-sensitive content and timestamps at each hop.

2. Architecture and decisions

Origin emission timestamps → proxy receive/flush trace → client receive timestamps → scoped configuration test

Compare direct and proxied requests with the same payload and a client that reports chunk arrival times. Check application flushes, reverse-proxy buffering, compression and intermediary behavior. Headers alone do not prove a browser received data incrementally. Identify the first hop where regularly emitted chunks become a single burst.

Apply a narrow route-specific change using supported proxy controls, then verify both streaming and ordinary downloads. Preserve authentication and rate limits. Add a small heartbeat only if it serves the stream contract and does not leak content; heartbeats cannot fix every buffering layer. Define disconnect handling so abandoned client streams stop consuming upstream work.

3. Work through the example

If the origin emits 100 bytes every 100 ms, its payload rate is 1,000 bytes/s. A hypothetical intermediary that waits for 16,000 bytes before flushing adds about 16 seconds before the first flush, unless another trigger fires. This is a diagnostic model, not a claim that every proxy uses a 16 KB threshold.

4. Failure cases and trade-offs

Client libraries may buffer even after the proxy is fixed. Compression can change flush behavior. Disabling buffering globally may raise resource use for unrelated routes. A successful first-byte measurement can still hide later stalls, so assess the full chunk cadence and disconnect cleanup.

5. Validation and acceptance

Acceptance compares time to first visible token, longest inter-chunk gap and total completion time on the customer path. Test idle periods, slow readers, client cancellation and normal non-streaming responses. Document the exact changed route and rollback.

6. Follow-ups and self-review

How would you distinguish origin batching from proxy buffering? Reward hop-by-hop evidence, scoped changes and user-visible timing rather than a speculative timeout increase.

Sources and related practice

NGINX documents proxy buffering controls; the investigation and numerical threshold are original hypothetical examples.

Read the primary technical reference

Reference retrieved October 3, 2026. Retrieval date is not an interview or source publication date. The reference supports the named concept; scenario, architecture, examples and rubric are original.

Continue with Replace fragile long HTTP requests with jobs; Design a real-time voice assistant.

Continue your preparation

Choose a connected learning path or browse more FDE interviews questions. Read our editorial method and attribution policy.