Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Fix Sequential Async HTTP

HardCoding00:00
Practice interviewer
In session
5 left
00:00

Your question is Fix Sequential Async HTTP. Take a moment with it on the right.

Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).

You need to log in / sign up to chat or submit.

Problem

You're reviewing a service that makes parallel HTTP requests to fetch metadata for a list of product IDs. The code is implemented using asyncio and httpx and is meant to run concurrently. But logs show that it processes one request at a time, defeating the entire point of async.

Your task:

Identify the bug that causes sequential execution despite using async/await. Rewrite the function to make full use of concurrency. Explain what await does and why it's causing the issue here.