Model why async helps I/O-bound work
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Model why async helps I/O-bound work. Three API calls take 0.3, 0.5, 0.2 seconds of WAITING. Run sequentially the total time is the sum; run concurrently (overlapping the waits) the total time is the longest single wait. Print the sequential total then the concurrent total, each rounded to 1 decimal, one per line. (Model it with plain arithmetic, no asyncio.)
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.