Bird
0
0

You have a Django view that calls two slow external APIs one after another. How can async improve this?

hard📝 Application Q8 of 15
Django - Async Django
You have a Django view that calls two slow external APIs one after another. How can async improve this?
ABy awaiting both API calls concurrently to reduce total wait time
BBy converting APIs to synchronous calls
CBy running the APIs sequentially inside an async view
DBy caching API responses only
Step-by-Step Solution
Solution:
  1. Step 1: Identify async concurrency advantage

    Async allows multiple I/O tasks to run concurrently.
  2. Step 2: Apply concurrency to API calls

    Awaiting both API calls concurrently reduces total latency.
  3. Final Answer:

    By awaiting both API calls concurrently to reduce total wait time -> Option A
  4. Quick Check:

    Concurrent awaits reduce total I/O wait [OK]
Quick Trick: Await multiple I/O calls concurrently to save time [OK]
Common Mistakes:
MISTAKES
  • Running slow APIs sequentially inside async view
  • Assuming async converts sync APIs automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes