Build a REST-driven event interface with SSE and a complete chat request lifecycle. Explain framing, replay, deduplication, cleanup, partial failures, and how to verify AI-generated implementation pieces.
Build a REST and SSE Event UI with an AI Chat Component
Company: DoorDash
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Onsite
In Next.js, implement REST endpoints and a Server-Sent Events stream, display streamed events in a UI, and add an AI chat component. Describe how you would use an AI coding assistant while retaining responsibility for the specification and correctness.
### Constraints and Clarifying Questions
The event schema, persistence, authentication, chat provider, and reconnect policy are not specified. Define a small explicit contract before implementation. Prioritize a functioning REST-to-event-stream path and then the chat component. The chat must have a real request, response, failure, and completion model; a visual input alone is not a completed design.
### What a Strong Answer Covers
Endpoint responsibilities, SSE framing, client subscription lifecycle, reconnection and duplicate handling, REST mutation behavior, chat request state, cancellation, and a bounded AI-assisted implementation workflow.
### Follow-up Questions
- What happens when the browser reconnects after missing events?
- Why should creating an event use a mutation endpoint rather than the SSE subscription itself?
- How would you prevent a failed chat request from looking like a completed answer?
Overview: Build a REST-driven event interface with SSE and a complete chat request lifecycle. Explain framing, replay, deduplication, cleanup, partial failures, and how to verify AI-generated implementation pieces.
In Next.js, implement REST endpoints and a Server-Sent Events stream, display streamed events in a UI, and add an AI chat component. Describe how you would use an AI coding assistant while retaining responsibility for the specification and correctness.
Constraints and Clarifying Questions
The event schema, persistence, authentication, chat provider, and reconnect policy are not specified. Define a small explicit contract before implementation. Prioritize a functioning REST-to-event-stream path and then the chat component. The chat must have a real request, response, failure, and completion model; a visual input alone is not a completed design.
What a Strong Answer Covers Guidance
Endpoint responsibilities, SSE framing, client subscription lifecycle, reconnection and duplicate handling, REST mutation behavior, chat request state, cancellation, and a bounded AI-assisted implementation workflow.
Follow-up Questions Guidance
What happens when the browser reconnects after missing events?
Why should creating an event use a mutation endpoint rather than the SSE subscription itself?
How would you prevent a failed chat request from looking like a completed answer?