BackgroundTasks — Work After the Response — Concept Check
Questions on BackgroundTasks — Work After the Response. BackgroundTasks runs functions after the response is sent — perfect for emails, logs, and webhooks the user shouldn't wait for. Know its limits: in-process, no retries, dies with the worker — that's where Celery/ARQ enter.
Questions in this quiz
8 questions on BackgroundTasks — Work After the Response — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A user registers on your platform, and you need to send a welcome email without making them wait. Which tool should you use?
- ACelery
- BARQ
- CBackgroundTasks
- DDirect SMTP call
2.You have a task that must not be lost and requires retries if it fails. Which tool should you choose?
- ACelery
- BThread pool
- CBackgroundTasks
- DDirect SMTP call
3.A service uses BackgroundTasks to send emails, but some are lost during server restarts. Why?
- ASMTP server is down
- BEmails are sent too quickly
- CBackgroundTasks lacks persistence
- DIncorrect email addresses
4.You need to run a task nightly at 2 AM. What is the best approach?
- AUse Celery with beat scheduling
- BRun a cron job
- CUse a thread pool
- DUse BackgroundTasks
5.A task in BackgroundTasks takes longer than expected and affects request handling. Why?
- ASMTP server is slow
- BNetwork latency
- CTasks run in the same process
- DIncorrect task configuration
6.Which of the following is NOT a limitation of BackgroundTasks?
- ANo persistence
- BNo support for async tasks
- CNo task visibility
- DNo retries
7.You're using BackgroundTasks, but emails occasionally fail due to temporary SMTP issues. What should you do?
- AUse a faster SMTP server
- BIncrease server capacity
- CSwitch to Celery for retries
- DSend emails synchronously
8.You need to ensure a task can scale independently of your API servers. Which tool is appropriate?
- ADirect SMTP call
- BCelery
- CBackgroundTasks
- DThread pool