Interview practice question
Speeding up thousands of API calls
Data Engineering · Python · Intermediate
You need to call an API once for each of 50,000 product IDs, and doing it sequentially takes 10 hours. How do you speed it up?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- The work is I/O-bound, so concurrency helps.
- Use ThreadPoolExecutor or asyncio with a concurrency limit.
- Stay under the API rate limit.
- Handle failures per ID and retry them.
- Check if the API offers a bulk endpoint first.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.