Quiz Space

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

Question 31: Consider the below flask application. app.py: If the Red…

Question 31

+4.5 marksOne correct option

Consider the below flask application.

app.py:

python
from flask import Flask
from flask_caching import Cache
from time import sleep
config = {
"CACHE_TYPE": "RedisCache",
"CACHE_REDIS_URL": 'redis://localhost:6379/1'
}
app = Flask(__name__)
app.config.from_mapping(config)
cache = Cache(app)
@cache.memoize(timeout=120)
def get_score(name):
sleep(10)
return 0
@app.route('/match/<int:match_id>/player/<name>/score')
def score(match_id, name):
score = get_score(name)
return f"IND Vs AUS- SKY: {score}"
if __name__ == '__main__':
app.run(debug=True)

If the Redis server is running on “localhost:6379”, and application is running on “http://127.0.0.1:5000”. If a user visits the URL “http://127.0.0.1:5000/match/1/player/sky/score” at 7AM in the morning for the first time and then at 9AM for the second time. What will be the approximate absolute difference between the response time of the requests?

  1. A

    10 seconds

  2. B

    0 seconds

  3. C

    20 seconds

  4. D

    120 Seconds

Show answer

Correct answer

  • B

    0 seconds

Question 31 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 4.5 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. Q24Suppose an endpoint in your flask application triggers a celery task, which generates a CSV file named “data.csv” and s…
  25. Q25Consider the following Vue application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppo…
  26. Q26Consider the following javascript program, and predict the output if executed.
  27. Q27Consider the following Vue application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppo…
  28. Q28Which of the following shows the correct output if the javascript program written below is executed?
  29. Q29Consider the below application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppose you o…
  30. Q30Consider the below application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppose you o…
  31. Q32Consider the below flask application. app.py: If the Redis server is running on “localhost:6379”, and application is ru…