AI Agent Architect
An AI Agent Architect designs, builds, and orchestrates autonomous AI agent systems that plan, reason, use tools, and collaborate …
Skill Guide
A software engineering discipline focused on building highly concurrent, non-blocking I/O applications using Python's asyncio ecosystem and event-driven architectural patterns to handle thousands of simultaneous operations efficiently.
Scenario
You need to scrape product prices from 100 different URLs on an e-commerce site as fast as possible without getting rate-limited.
Scenario
Build a WebSocket-based chat application that broadcasts messages to all connected clients, handling disconnects and reconnections gracefully.
Scenario
Design a system where an 'Order Service' publishes an 'OrderCreated' event, which triggers asynchronous, decoupled workflows in 'Inventory', 'Payment', and 'Notification' services.
asyncio is the foundation. aiohttp is for async HTTP clients/servers. Starlette/FastAPI are modern ASGI frameworks for building async web APIs. uvicorn is the high-performance server to run them.
aiopg/aiomysql for non-blocking database access. aioredis for async Redis (caching, pub/sub). aiokafka for high-throughput event streaming. Celery can be used for offloading CPU-bound tasks from the async loop.
pytest-asyncio is essential for writing async tests. Use asyncio's debug mode (PYTHONASYNCIODEBUG=1) during development to detect issues like blocking calls. py-spy can profile running async code to find bottlenecks.
Answer Strategy
Structure the answer using a systematic debugging framework: 1) Observability: Check metrics/logs for correlated events (DB queries, external calls). 2) Isolation: Use py-spy or asyncio's debug mode to profile the event loop and identify blocking calls (e.g., a synchronous HTTP call). 3) Diagnosis: Look for resource leaks (unclosed connections, tasks not being awaited). 4) Resolution: Fix the blocking code with an async alternative, implement circuit breakers, or optimize task batching. Sample: 'I'd start by checking APM traces and logs for correlated slowdowns. Using asyncio's debug mode or py-spy on a staging instance, I'd look for functions blocking the event loop, such as a synchronous database call made without run_in_executor. I'd also inspect for unhandled task exceptions causing resource leaks. The fix would involve replacing the blocking call with its async counterpart (e.g., using asyncpg) and adding proper timeout and error handling.'
Answer Strategy
Tests strategic thinking and understanding of trade-offs. The framework should focus on the problem domain: I/O-bound vs CPU-bound, concurrency needs, and operational complexity. Sample: 'For a high-concurrency API gateway handling 10k+ concurrent connections with mostly I/O wait (external API calls), I chose asyncio for its lightweight tasks and lower context-switching overhead. The decision matrix was: 1) Task nature: I/O-bound vs CPU-bound. 2) Concurrency level: asyncio excels for high concurrency of slow I/O. 3) Developer familiarity and existing libraries. We avoided it for a separate CPU-heavy data processing service, where multiprocessing was more suitable.'
1 career found
Try a different search term.