Quiz Space

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

Question 24: Suppose an endpoint in your flask application triggers a…

Question 24

+2 marksOne correct option

Suppose an endpoint in your flask application triggers a celery task, which generates a CSV file named “data.csv” and saves it in the static folder of a flask application. The file generator takes anywhere between 20 and 40 seconds to generate and save the CSV file.
The below fetch call is used to get the file generated by the above explained celery task.

Which of the following is the most efficient way to make the above fetch call so that it doesn’t fail and return the desired response?

  1. A

    Use short polling to check the state of the celery task after every 5 seconds, and make the fetch call, when the task succeeds.

  2. B

    Use javascript function “setTimeout” to make the fetch after 41 seconds, which makes sure that the file is generated and saved to the desired location.

Show answer

Correct answer

  • A

    Use short polling to check the state of the celery task after every 5 seconds, and make the fetch call, when the task succeeds.

Question 24 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 2 marks.

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. Q20Suppose you are building an application which requires sending emails to all the users stored in the database at regula…
  21. Q21Which of the following statement(s) is/are correct regarding Vue.js framework?
  22. Q22Which of the following statements is false about VueJS framework?
  23. Q23Which of the following statements is false regarding webhooks?
  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…