Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
Modern Application Development II
Celery, queues, webhooks & SSE
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
End Term · 31 Aug 2025 (FN)End Term
- Q1MCQ2 Marks·Choose one option
In a message queue system, if the consumer is slower than the producer, what is likely to occur first?
- AMessages will be dropped
- BThe producer will block until the consumer is ready
- CMessages will accumulate in the queue
- DThe consumer will speed up automatically
- Q2MSQ2 Marks·Choose all correct options
Which of the following is/are the potential benefits of using a message broker?
- AA message broker allows two servers in a network to directly communicate with each other, without an intermediary.
- BA message broker makes the network scalable for adding more servers to the network.
- CA message broker can be used for batch processing of messages.
- DA message broker is not suited in case of traffic spikes, as messages are retained in the queue until processed.
- Q3MSQ2 Marks·Choose all correct options
Which statements about webhooks are correct?
- AThey enable real-time data delivery
- BThey require polling from the client
- CThey use HTTP POST requests typically
- DThey're designed for server-to-server communication
- Q4MCQ3 Marks·Choose one option
A popular e-commerce platform needs to notify multiple third-party services (inventory management, email marketing, analytics) whenever a customer places an order. The development team is considering different approaches to handle these notifications. Scenario: When an order is placed, the system needs to: ● Update inventory levels in an external warehouse system ● Send a welcome email through a third-party email service ● Log analytics data to an external tracking service ● Update customer loyalty points in a CRM system Which of the following statements about using webhooks for this scenario is MOST accurate?
- AWebhooks are not suitable for this use case because they require the e- commerce platform to continuously poll each third-party service to check if they're ready to receive data, which would create unnecessary network overhead.
- BWebhooks provide an ideal solution as they allow the e-commerce platform to push real-time notifications to all subscribed third-party services immediately when an order is placed, eliminating the need for these services to repeatedly poll for updates.
- CWebhooks should be avoided in this scenario because they operate synchronously, meaning the customer's order placement would be delayed until all third-party services have successfully processed their notifications.
- DWebhooks are primarily designed for read-only operations and cannot handle complex data payloads like order information, making them unsuitable for e-commerce transaction notifications.
- Q5MSQ3 Marks·Choose all correct options
Which statements are true about handling background tasks in Flask with Celery?
- ACelery allows long-running tasks to be executed asynchronously
- BPolling is a strategy to check task status periodically
- CUsing time.sleep() blocks the event loop and is recommended for async tasks
- DFlask + Celery + Redis is a common stack for async task management
End Term · 31 Aug 2025 (AN)End Term
- Q6MCQ2 Marks·Choose one option
In a message queue system, if the consumer is slower than the producer, what is likely to occur first?
- AMessages will be dropped
- BMessages will accumulate in the queue
- CThe consumer will speed up automatically
- DThe producer will block until the consumer is ready
- Q7MSQ2 Marks·Choose all correct options
Which of the following is/are the potential benefits of using a message broker?
- AA message broker makes the network scalable for adding more servers to the network.
- BA message broker allows two servers in a network to directly communicate with each other, without an intermediary.
- CA message broker is not suited in case of traffic spikes, as messages are retained in the queue until processed.
- DA message broker can be used for batch processing of messages.
- Q8MSQ2 Marks·Choose all correct options
Which statements about webhooks are correct?
- AThey enable real-time data delivery
- BThey use HTTP POST requests typically
- CThey're designed for server-to-server communication
- DThey require polling from the client
- Q9MCQ3 Marks·Choose one option
A popular e-commerce platform needs to notify multiple third-party services (inventory management, email marketing, analytics) whenever a customer places an order. The development team is considering different approaches to handle these notifications. Scenario: When an order is placed, the system needs to: ● Update inventory levels in an external warehouse system ● Send a welcome email through a third-party email service ● Log analytics data to an external tracking service ● Update customer loyalty points in a CRM system Which of the following statements about using webhooks for this scenario is MOST accurate?
- AWebhooks are not suitable for this use case because they require the e- commerce platform to continuously poll each third-party service to check if they're ready to receive data, which would create unnecessary network overhead.
- BWebhooks should be avoided in this scenario because they operate synchronously, meaning the customer's order placement would be delayed until all third-party services have successfully processed their notifications.
- CWebhooks provide an ideal solution as they allow the e-commerce platform to push real-time notifications to all subscribed third-party services immediately when an order is placed, eliminating the need for these services to repeatedly poll for updates.
- DWebhooks are primarily designed for read-only operations and cannot handle complex data payloads like order information, making them unsuitable for e-commerce transaction notifications.
- Q10MSQ3 Marks·Choose all correct options
Which statements are true about handling background tasks in Flask with Celery?
- AUsing time.sleep() blocks the event loop and is recommended for async tasks
- BCelery allows long-running tasks to be executed asynchronously
- CPolling is a strategy to check task status periodically
- DFlask + Celery + Redis is a common stack for async task management
End Term · 22 Dec 2024 (FN)End Term
- Q11MCQ3 Marks·Choose one option
Which of the following is true regarding long polling?
- ALong polling opens multiple connections between the client and the server, and the server continuously sends updates to the client in real-time.
- BLong polling involves the client repeatedly sending requests at fixed intervals to the server to check for updates, regardless of whether new data is available.
- CLong polling allows the client to make a single request to the server, where the server holds the connection open until new data is available and then sends the response.
- DLong polling uses WebSockets to maintain a persistent, bidirectional connection between the client and the server.
End Term · 22 Dec 2024 (AN)End Term
- Q12MCQ3 Marks·Choose one option
Which of the following is true regarding long polling?
- ALong polling opens multiple connections between the client and the server, and the server continuously sends updates to the client in real-time.
- BLong polling allows the client to make a single request to the server, where the server holds the connection open until new data is available and then sends the response.
- CLong polling involves the client repeatedly sending requests at fixed intervals to the server to check for updates, regardless of whether new data is available.
- DLong polling uses WebSockets to maintain a persistent, bidirectional connection between the client and the server.
- Q13MCQ3 Marks·Choose one option

- AII, III, I
- BIII, I, II
- CIII, II, I
- DI, II, III
- Q14MCQ2 Marks·Choose one option
You have a Celery task send_email that needs to run every 10 minutes. How can you schedule it?
- AUsing @app.task_periodic to run the task every 10 minutes.
- BUsing @app.on_periodic to schedule a periodic task.
- CUsing Celery Beat to schedule periodic tasks.
- DCelery doesn't support scheduling tasks at fixed intervals; you need to use an external scheduler.
- Q15MCQ4.5 Marks·Choose one option

- AThe task will immediately execute and print the result 'Task completed'.
- BThe task will execute asynchronously, and 'Task completed' will be printed after a 10-second delay.
- CThe task will execute synchronously, blocking the main thread for 10 seconds.
- DNone of these
- Q16MSQ3 Marks·Choose all correct options
Which of the following statements correctly describe the use of asynchronous messaging systems and frameworks?
- ACelery allows web servers to offload long-running tasks to worker processes, decoupling task execution from user requests.
- BPush queues are used for real-time operations, while pull queues are better suited for batch processing.
- CServer-Sent Events (SSE) provide a persistent connection between server and client, enabling bi-directional communication.
- DRedis is a high-performance in-memory database that supports Pub/Sub.
- Q17MSQ3 Marks·Choose all correct options
Which of the following statement(s) is/are true about Webhooks?
- AA Webhook is a method for a server to send real-time data to another server as an HTTP POST request.
- BWebhooks are typically used for sending periodic updates at regular intervals.
- CA client must continuously poll a Webhook URL to receive data.
- DWebhooks are usually used in event-driven architectures, where an event triggers an HTTP POST request to a specified endpoint.
- Q18MSQ3 Marks·Choose all correct options
Which of the following statement(s) is/are true regarding Server-Sent Events (SSE) and WebSockets?
- ASSE is a two-way communication protocol, while WebSockets are unidirectional.
- BWebSockets are more suited for scenarios requiring bi-directional communication.
- CSSE is based on HTTP and can only be used for server-to-client communication, while WebSockets are based on TCP and support both directions.
- DSSE is an extension of WebSockets, providing enhanced support for server-to- client communication.
- Q19MSQ3 Marks·Choose all correct options
Which of the following is/are typical use case(s) for Celery tasks?
- AProcessing time-consuming or resource-intensive background jobs asynchronously.
- BDirectly handling incoming HTTP requests in web servers.
- CScheduling periodic tasks like sending emails or cleaning up the database.
- DServing real-time notifications over WebSockets.