System Design Task: Minimal Conversational Chatbot (2-hour build)
Goal
Design and implement a minimal yet functional conversational chatbot using the OpenAI API that you can run locally within a two-hour coding exercise.
Requirements
-
Architecture
-
API server
-
Message schema
-
Session state
-
Context window strategy (how you fit conversation into model limits)
-
Streaming responses to the client
-
Resilience
-
Handle rate limits (429), retries, and generic errors
-
Operations
-
Logging and metrics for quick debugging
-
Lightweight persistence option
-
Basic safety checks (content moderation / guardrails)
-
Deliverables
-
Project structure
-
Key API endpoints
-
Exact steps to run locally
-
Optional: How an AI IDE (e.g., Cursor) speeds delivery