▸case-01 I am building a new Python backend that needs to handle high-concurrency real-time events alongside standard database CRUD operations. Could you advise me on choosing between a sync or async architecture, recommend a suitable web framework, and explain how to structure the project for clean maintainability? | fail→fail | 18,920 | 24,088 | +27% | 1 | 1 | 0% | 3,503 | 4,497 | +28% | 0 | 0 | — |
▸case-02 I am writing an API service in Python that makes outbound HTTP calls to third-party services and also performs heavy data calculations. How should I decide whether my route handlers should be defined as synchronous or asynchronous functions, and what approach should I use for dependency injection and request validation? | fail→fail | 22,467 | 20,909 | -7% | 1 | 1 | 0% | 3,758 | 3,660 | -3% | 0 | 0 | — |
▸case-03 We are setting up a modern Python service and want to establish robust architectural conventions. Can you guide us on designing an exception handling strategy, formatting standard API error responses, and organizing our pytest fixtures for async test suites? | fail→fail | 27,930 | 24,810 | -11% | 1 | 1 | 0% | 4,836 | 4,916 | +2% | 0 | 0 | — |
▸case-04 We are optimizing the Dockerfile for our Python backend service to reduce image size and build times. Should we use multi-stage builds with gcc installed in the builder stage, and how do we leverage Docker layer caching for pip wheel installations? | fail→fail | 20,915 | 21,863 | +5% | 1 | 1 | 0% | 3,121 | 3,791 | +21% | 0 | 0 | — |
▸case-05 We are troubleshooting high database query latencies on PostgreSQL behind a Python ORM. How should we analyze query execution plans using EXPLAIN ANALYZE and select appropriate database indexes like B-Tree or GIN for JSONB fields? | pass→pass | 27,199 | 22,382 | -18% | 1 | 1 | 0% | 4,119 | 3,932 | -5% | 0 | 0 | — |
▸case-06 We are investigating a memory leak in a long-running Python background process. How should we use the tracemalloc module to take snapshots and trace object allocations across memory diffs? | pass→pass | 21,735 | 23,207 | +7% | 1 | 1 | 0% | 3,181 | 4,092 | +29% | 0 | 0 | — |
▸case-07 We have a FastAPI application using standard synchronous SQLAlchemy ORM calls (not async SQLAlchemy). Our engineer wants to declare all endpoint functions as async def. Should synchronous ORM calls be run inside async def route handlers in FastAPI, or should def be used instead? | pass→pass | 17,567 | 17,398 | -1% | 1 | 1 | 0% | 2,162 | 2,929 | +35% | 0 | 0 | — |
▸case-08 We are updating a legacy Pydantic model to Pydantic v2. The old code used @validator('age') with a classmethod signature to enforce that age is over 18. What decorator and method signature should be used in Pydantic v2 for field validation? | pass→pass | 13,099 | 5,646 | -57% | 1 | 1 | 0% | 1,609 | 1,846 | +15% | 0 | 0 | — |
▸case-09 We are setting up async integration tests in pytest using pytest-asyncio. A developer wants to create an async database session fixture with scope='module'. Is sharing an async event loop across module-scoped fixtures safe by default in pytest-asyncio, and how should fixture scope and event loops be managed? | pass→pass | 20,100 | 13,780 | -31% | 1 | 1 | 0% | 2,812 | 3,113 | +11% | 0 | 0 | — |
▸case-10 We are designing a microservice that runs CPU-heavy image blurring algorithms on incoming JPEG files. A team member proposes using asyncio with async def route handlers to make processing faster. Will asyncio speed up CPU-bound image processing tasks? | pass→pass | 12,611 | 17,568 | +39% | 1 | 1 | 0% | 2,145 | 2,934 | +37% | 0 | 0 | — |
▸case-11 We are building a Django 5.0 application. An engineer wants to perform database queries inside an async def view using standard ORM calls like User.objects.get(id=1). Can standard Django ORM queries be called directly inside async views without special wrappers? | pass→pass | 9,965 | 13,945 | +40% | 1 | 1 | 0% | 1,963 | 2,403 | +22% | 0 | 0 | — |
▸case-12 We are updating our Python code base targeting Python 3.10+. When defining a function parameter that can be either an integer or None, should we use typing.Optional[int] or the Python 3.10+ union operator syntax? | pass→pass | 8,386 | 6,265 | -25% | 1 | 1 | 0% | 1,523 | 1,871 | +23% | 0 | 0 | — |
▸case-13 In our Python web service, business logic functions directly instantiate HTTP client sessions inside the function body. Why is this hard to unit test, and what pattern resolves this issue? | pass→pass | 21,113 | 19,601 | -7% | 1 | 1 | 0% | 2,989 | 3,454 | +16% | 0 | 0 | — |
▸case-14 In an API layer, business validation logic raises web framework HTTP exceptions directly deep inside the domain model classes. Is this good practice for layering, and how should domain errors be handled? | pass→pass | 17,918 | 14,871 | -17% | 1 | 1 | 0% | 2,574 | 3,610 | +40% | 0 | 0 | — |
▸case-15 In an async Python service, an engineer creates a new async HTTP client instance inside every incoming request handler function and closes it at the end of the request. Is this efficient, and how should HTTP client connections be managed? | pass→pass | 19,547 | 15,388 | -21% | 1 | 1 | 0% | 2,606 | 2,584 | -1% | 0 | 0 | — |
▸case-16 We are defining data transfer objects in Pydantic v2. In Pydantic v1, model configuration was set using an inner class Config. How is model configuration defined in Pydantic v2? | pass→pass | 7,431 | 10,262 | +38% | 1 | 1 | 0% | 1,465 | 1,693 | +16% | 0 | 0 | — |
▸case-17 When writing test suites with pytest-asyncio, test functions require @pytest.mark.asyncio on every single test. How can we configure pytest.ini so that async test functions are automatically recognized without repeating the decorator on every test? | pass→pass | 10,368 | 10,481 | +1% | 1 | 1 | 0% | 1,007 | 1,758 | +75% | 0 | 0 | — |
▸case-18 We are running multiple concurrent async I/O tasks in Python 3.11+. The team is deciding between asyncio.gather() and Python 3.11's asyncio.TaskGroup. If one task fails with an unhandled exception, how do these two constructs differ in exception propagation and child task cancellation? | pass→pass | 18,966 | 19,649 | +4% | 1 | 1 | 0% | 2,637 | 3,571 | +35% | 0 | 0 | — |
▸case-19 We are organizing a medium-to-large FastAPI codebase. One team member proposes putting all schemas in schemas.py, all models in models.py, and all routers in routers.py. Another proposes grouping by domain features. Which project structure scales better as the codebase grows? | pass→pass | 19,094 | 12,359 | -35% | 1 | 1 | 0% | 2,502 | 2,838 | +13% | 0 | 0 | — |
▸case-20 We need to process background email sending after an API request returns. The job takes 2 seconds and we handle 5 requests per minute. Should we install Celery with Redis for this background work, or use a simpler built-in mechanism? | pass→pass | 18,722 | 15,184 | -19% | 1 | 1 | 0% | 2,100 | 2,427 | +16% | 0 | 0 | — |
▸case-21 In a Pydantic v2 schema, we want a field full_name that is dynamically calculated from first_name and last_name and automatically included when serializing the model to JSON. What Pydantic v2 decorator should be used on property methods? | pass→pass | 8,515 | 8,699 | +2% | 1 | 1 | 0% | 638 | 1,408 | +121% | 0 | 0 | — |
▸case-22 Our async Python service needs to read files from disk during API request handling. Standard open() and file.read() are synchronous blocking operations. What strategy or library should be used to avoid blocking the event loop during file I/O? | pass→pass | 12,846 | 12,442 | -3% | 1 | 1 | 0% | 2,436 | 2,982 | +22% | 0 | 0 | — |