Loading...
Loading...
Browse 3 real-world technical and behavioral interview questions about Asyncio. Review scenarios, edge cases, and architectural best practices.
The Python GIL serializes CPython bytecode execution, but threads still help I/O-bound work; choose processes for pure Python CPU work and asyncio for many concurrent waits.
An N+1 happens when the ORM follows a relation lazily once per row; select_related fixes forward foreign keys with a SQL join, prefetch_related issues one extra query per relation and joins in Python. An async endpoint gets slower when it contains a blocking call, because that stalls the whole event loop.
With gather they keep running unsupervised and their failures may surface as an unretrieved-exception warning. A TaskGroup, added in Python 3.11, cancels the siblings, waits for them to finish unwinding, and raises an ExceptionGroup you handle with except*.