Quiz Space

Modern Application Development II · End Term · 3 Sept 2023 · May 2023 term · Set QPD1-S2

Question 23: Consider the flask application. app.py: Suppose the appl…

Question 23

+4.5 marksOne correct option

Consider the 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(50)
return name
if __name__ == '__main__':
app.run()

Suppose the application is running on “http://localhost:5000”. If the client makes two requests to URL “http://localhost:5000/name/mohan” and “http://localhost:5000/name/sohan” 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

  • C

    0 Seconds

Question 23 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 4.5 marks.

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”. app.js: Suppose the appl…
  6. Q6Consider the below Vue application with markup file “index.html” and javascript file “app.js”. app.js: Suppose you open…
  7. Q7Consider the below javascript program, and predict the output, if executed.
  8. Q8Which of the following statements is true regarding long polling?
  9. Q9Consider the following flask application. app.py: Suppose the application is running on “http://localhost:5000”. If the…
  10. Q10What will be the output of the following javascript code.
  11. Q11Consider the below Vue application with markup file “index.html” and javascript file “app.js”. index.html: app.js: Supp…
  12. Q12Consider the below Vue application with markup file “index.html” and javascript file “app.js”. app.js: Suppose the appl…
  13. Q13Which of the following is/are not the example(s) of ephemeral state?
  14. Q14Which of the following statement(s) is/are true in general?
  15. Q15Which of the following statement(s) is/are correct regarding the execution context in JavaScript?
  16. Q16Which of the following statements is/are correct regarding the prototype in javascript?
  17. Q17Which of the following statements is/are correct?
  18. Q18Which of the following statements is/are true regarding the celery in python?
  19. Q19Which of the following statements is false regarding async and await?
  20. Q20Which of the following statements is false regarding HTTP and fetch API?
  21. Q21Consider the following Vue application with markup “index.html” and javascript file “app.js”. index.html: app.js: Suppo…
  22. Q22Consider the below flask app, and an HTML file named “index.html”. app.py: index.html: Suppose you open the “index.html…
  23. Q24Consider the below Vue application with markup file “index.html” and javascript file “app.js”. app.js: If the applicati…
  24. Q25Consider the below Vue application with markup file “index.html” and javascript file “app.js”. app.js: Suppose the appl…
  25. Q26Consider the below Vue application with markup file “index.html” and javascript file “app.js”. app.js: Suppose the appl…
  26. Q27Consider the below Vue component and a Vuex store implementation. You are supposed to invoke the mutation function “upd…
  27. Q28Consider the given 2 implementations. Approach 1: driver code: celery job: Approach 2: driver code: celery job: Suppose…
  28. Q29Which of the following statement(s) is/are true regarding flask_caching and caching in general?
  29. Q30Which of the following statements is/are true?
  30. Q31Figure question
  31. Q32Which of the following statement is/are true in context of lighthouse?