Quiz Space

Modern Application Development II · End Term · 3 Sept 2023 · May 2023 term · Set QPF1-S1

Question 8: Consider the following flask application. app.py: Suppose…

Question 8

+3 marksOne correct option

Consider the following flask application.

app.py:

python
from flask import Flask
from flask_caching import Cache
import time
config = {
"DEBUG": True,
"CACHE_TYPE": "RedisCache",
"CACHE_REDIS_URL": "redis://localhost:6379/1",
"CACHE_DEFAULT_TIMEOUT": 300
}
app = Flask(__name__)
app.config.from_mapping(config)
cache = Cache(app)
@app.get('/name/<name>')
@cache.cached(timeout=100)
def get_name(name):
time.sleep(30)
return name
if __name__ == '__main__':
app.run()

Suppose the application is running on “http://localhost:5000”. If the client makes two requests (one after another) to URL “http://localhost:5000/name/mohan” within 50 seconds. What will be the approximate absolute difference between their latencies?

  1. A

    30 Seconds

  2. B

    40 Seconds

  3. C

    0 Seconds

  4. D

    None of these

Show answer

Correct answer

  • A

    30 Seconds

Question 8 of 32 in the IIT Madras BS Modern Application Development II (MAD 2) End Term paper sat on 3 Sept 2023, in the May 2023 term (IIT M FOUNDATION ET1 EXAM QPF1 S1 03 Sep). It carries 3 marks.

This question was also asked in

More questions from this paper

  1. Q1Consider the below HTML document. index.html: Suppose you open the “index.html” file in a browser, and click on the tab…
  2. Q2Consider the below HTML document. index.html: Suppose you open the “index.html” file in a browser, and click on the tab…
  3. Q3Consider the following JavaScript program, and predict the output if executed.
  4. Q4Match the Vue directives / constructs with their function.
  5. Q5Consider the below Vue application with markup file “index.html” and javascript file “app.js”. index.html: app.js: Supp…
  6. Q6Consider the below Vue application with markup file “index.html” and javascript file “app.js”. index.html: app.js: Supp…
  7. Q7Consider the below javascript program, and predict the output, if executed.
  8. Q9What will be the output of the following javascript code.
  9. Q10Consider the below Vue application with markup file “index.html” and javascript file “app.js”. index.html: app.js: Supp…
  10. Q11Consider the Vue application
  11. Q12Which of the following is/are example(s) of ephemeral state?
  12. Q13Which of the following statement(s) is/are false in general?
  13. Q14Which of the following statement(s) is/are correct regarding the execution context in JavaScript?
  14. Q15Which of the following statements is/are correct regarding the prototype in javascript?
  15. Q16Which of the following statements is/are correct?
  16. Q17Which of the following statements is/are true regarding the celery in python?
  17. Q18Which of the following statements are true regarding async and await?
  18. Q19Which of the following statements is true regarding HTTP and fetch API?
  19. Q20Consider the following Vue application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppo…
  20. Q21Consider the below flask app, and an HTML file named “index.html”. app.py: index.html: Suppose you open the “index.html…
  21. Q22Consider the following flask application. app.py: Suppose the application is running on “http://localhost:5000”. If the…
  22. Q23Consider the below Vue application with markup file “index.html” and javascript file “app.js”. index.html: app.js: If t…
  23. Q24Consider the below Vue application with markup file “index.html” and javascript file “app.js”.
  24. Q25Consider the Vue application
  25. Q26Consider the below Vue component and a Vuex store implementation. You are supposed to invoke the mutation function “upd…
  26. Q27Consider the given 2 implementations. Approach 1: driver code: celery job: Approach 2: driver code: celery job: Suppose…
  27. Q28Which of the following statement(s) is/are false regarding flask_caching and caching in general?
  28. Q29Which of the following statements is/are true?
  29. Q30Figure question
  30. Q31Which of the following statement(s) is/are true regarding short polling?
  31. Q32Which of the following statements is/are true in context of lighthouse?