Quiz Space

Modern Application Development II · End Term · 30 Apr 2023 · January 2023 term · Set QPD1-S2

Question 20: Suppose you are building an application which requires s…

Question 20

+3 marksOne or more correct options

Suppose you are building an application which requires sending emails to all the users stored in the database at regular intervals. Given below are the two approaches to satisfy the requirement.

Approach 1:

python
@celery.task
def send_bulk_emails():
all_users = User.query.all() // Get all the user objects from the
database
for user in all_users:
// send email to the user
send_bulk_emails.delay() // invokes celery task

Approach 2:

python
@celery.task
def send_email(email):
// send email to the user
all_users = User.query.all() // Get all the user objects from the database
for user in all_users:
send_email.delay(user.email) // invokes celery task

Choose the correct statement(s).

Select all that apply.

  1. A

    Approach 1 will take more time than approach 2, if more than 2 celery workers are available.

  2. B

    Approach 2 will take more time than approach 1, if more than 2 celery workers are available.

  3. C

    Both the approaches will take same time (approx), if only 1 celery worker is available.

  4. D

    None of these

Show answer

Correct answers

  • A

    Approach 1 will take more time than approach 2, if more than 2 celery workers are available.

  • C

    Both the approaches will take same time (approx), if only 1 celery worker is available.

Question 20 of 32 in the IIT Madras BS Modern Application Development II (MAD 2) End Term paper sat on 30 Apr 2023, in the January 2023 term (IIT M DIPLOMA ET1 EXAM QPD1 S2 30 Apr 2023). It carries 3 marks.

This question was also asked in

More questions from this paper

  1. Q1Which of the following statement(s) is/are false regarding javascript language?
  2. Q2Which of the following statement(s) is/are true about cookies and CORS?
  3. Q3Figure question
  4. Q4Which of the following statement(s) is/are false about pub/sub messaging?
  5. Q5Which of the following statement(s) is/are false?
  6. Q6Which of the following shows the correct output if the javascript program written below is executed?
  7. Q7Which of the following statements is true in the context of REST?
  8. Q8Which of the following shows the correct output if the javascript program written below is executed?
  9. Q9Which of the following statements is false regarding a message broker?
  10. Q10Which of the following statement(s) is incorrect regarding the prototype in JavaScript?
  11. Q11Consider the below application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppose the u…
  12. Q12Consider the below application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppose the a…
  13. Q13Consider the below application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppose the a…
  14. Q14Consider the below application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppose the a…
  15. Q15Consider the below application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppose the a…
  16. Q16Consider the below application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppose the a…
  17. Q17Which of the following is/are not the correct ways to achieve the following.
  18. Q18Which of the following statement(s) is/are false regarding Vuex?
  19. Q19Which of the following statement(s) is/are false regarding forward and reverse proxy?
  20. Q21Which of the following statement(s) is/are correct regarding Vue.js framework?
  21. Q22Which of the following statements is false about VueJS framework?
  22. Q23Which of the following statements is false regarding webhooks?
  23. Q24Suppose an endpoint in your flask application triggers a celery task, which generates a CSV file named “data.csv” and s…
  24. Q25Consider the following Vue application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppo…
  25. Q26Consider the following javascript program, and predict the output if executed.
  26. Q27Consider the following Vue application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppo…
  27. Q28Which of the following shows the correct output if the javascript program written below is executed?
  28. Q29Consider the below application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppose you o…
  29. Q30Consider the below application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppose you o…
  30. Q31Consider the below flask application. app.py: If the Redis server is running on “localhost:6379”, and application is ru…
  31. Q32Consider the below flask application. app.py: If the Redis server is running on “localhost:6379”, and application is ru…