TechNuggets Academy

Production Python, Backend Development, and API Design

Free GSDC Certified Forward Deployed Engineer practice — 6 questions on Production Python, Backend Development, and API Design, with explanations. No sign-up. Full 12-question mixed test →

Question 1 of 6 · Production Python, Backend Development, and API Design
A team built a FastAPI service where all route handlers are declared with `async def`. One handler calls a synchronous third-party SDK function that performs a blocking network call taking 3 seconds. Under load testing with 50 concurrent requests, overall response times degrade far more than the 3-second SDK latency alone would explain. What is the BEST fix?
FastAPI automatically runs synchronous `def` route handlers in a separate thread pool executor, so a blocking call no longer stalls the single-threaded async event loop that all `async def` routes share within one worker.
Question 2 of 6 · Production Python, Backend Development, and API Design
A project's `poetry.lock` file pins `fastapi==0.104.1`, but a teammate's local environment reports `fastapi==0.109.0` after they ran `pip install fastapi --upgrade` directly. Which command restores their environment to match the versions the team has locked and tested?
`poetry install` reads `poetry.lock` and installs the exact pinned versions of every dependency, overwriting the manually upgraded package and restoring reproducibility.
Question 3 of 6 · Production Python, Backend Development, and API Design
An enterprise client requires that a public-facing API issue short-lived, stateless credentials that embed user role claims and can be independently verified by multiple downstream microservices without querying a shared session store. Which authentication approach BEST meets this requirement?
JWTs are self-contained and cryptographically signed, so any service holding the verification key can validate the token and read embedded role claims locally, with expiration enforcing short lifetimes and no shared state required.
Question 4 of 6 · Production Python, Backend Development, and API Design
You need a Pydantic v2 model field `age` that must be an integer, is required, and accepts any value from 0 through 120 inclusive, rejecting negative numbers and values above 120. Which field definition is correct?
Pydantic's numeric constraint parameters are `ge` (greater than or equal) and `le` (less than or equal), which correctly allow the inclusive range 0 through 120.
Question 5 of 6 · Production Python, Backend Development, and API Design
In a production Python service with a retry mechanism, an operation fails on its first attempt but is automatically retried and no operator action is required at this point. Which logging level is MOST appropriate for this specific log entry?
WARNING indicates an unexpected but non-fatal condition worth noting for later investigation, without demanding immediate operator intervention, which matches an automatically-retried transient failure.
Question 6 of 6 · Production Python, Backend Development, and API Design
Service A must notify Service B whenever an order is placed. Service B's processing can take up to 30 seconds, and Service A must not block or wait for that processing to complete before responding to its own caller. Which inter-service communication pattern is BEST?
Publishing to a message queue decouples the two services: Service A completes quickly after enqueueing the event, and Service B processes it independently whenever ready, satisfying the non-blocking requirement.
Ready for the real thing?

The full course: two full-length practice tests, video lessons for every exam domain, hands-on labs and detailed explanations.

$109.99 $34.99 with code FREETEST33 — valid through September 14.

Get my $34.99 deal →