Question library
Questions from real interviews. Drill any of them by voice in a couple of minutes, with an interviewer, a score and feedback.
Explain how async and await work in Python. What happens if you call a regular time.sleep inside a coroutine?JuniorA FastAPI service started responding with delays of several seconds under load, even though the CPU is barely used. The endpoints are declared with async def. How would you find the cause?Mid-levelDesign an aggregator service in FastAPI: for every incoming request it has to call five external services and build a single response from their replies. How do you keep latency low and stay resilient to failures in those services?Mid-levelYou have a FastAPI service, and under load the p99 latency climbs to seconds even though the CPU isn't busy. You suspect the event loop is being blocked. How would you find the cause and fix it?SeniorWrite an async function fetch_all that takes a list of URLs, an async function that fetches a single URL, and a limit on concurrent requests. It returns the results in the same order as the URLs, and a failure of one request must not take down the others.Senior