The Scenario
Users can click "Export Year-End Report". Generating the PDF takes 15 seconds of heavy CPU time. Currently, the API endpoint blocks the main thread, causing other users' requests to time out.
The Brief
Design a background job architecture to handle the PDF generation. Explain how the API will accept the request, delegate the work, and notify the user when the PDF is ready.
Deliverables
- An architectural diagram or explanation of the Job Queue (e.g., using Redis/BullMQ or AWS SQS)
- The code snippet for the API endpoint that enqueues the job and returns a `202 Accepted` status
- An explanation of how the frontend will know when the job is done (Polling vs. WebSockets)
Submission Guidance
Do not perform the PDF generation in the HTTP request handler. You must decouple the request from the processing.
Submit Your Work
Your submission is graded against the rubric on the right. If you pass, you get a public Badge URL you can share on LinkedIn. There is no draft save, so work offline first and paste your finished response here.