Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.62 KB

File metadata and controls

31 lines (21 loc) · 1.62 KB

🎤 Interview Q&A - FastAPI Status and Policy Service

1. Why was FastAPI a good fit for this lab?

FastAPI makes it straightforward to build typed request and response models, expose endpoints, and test APIs quickly.

2. What was the purpose of the system status endpoint?

It exposed runtime information such as CPU, memory, and disk usage for lightweight service observability.

3. Why were data models important in this service?

They ensured request payloads matched the expected structure before policy logic ran.

4. What kind of checks did the policy layer enforce?

The policy layer validated request size, method rules, rate-limiting behavior, and other defensive constraints.

5. Why add middleware to the application?

Middleware provided a centralized place for request logging and cross-cutting request handling logic.

6. How does psutil support this design?

psutil gives the service access to system resource information that can be returned through status endpoints.

7. Why test the API with both curl and Python requests?

Using multiple clients verifies endpoint behavior from both shell-based and programmatic perspectives.

8. What does policy enforcement achieve operationally?

It moves basic control checks closer to the service boundary so bad requests can be rejected consistently.

9. Why is typed validation useful in API work?

It reduces ambiguity, improves error reporting, and creates clearer contracts for consumers of the service.

10. Where would a service like this be useful?

It fits internal control services, status APIs, request filtering layers, and lightweight policy enforcement components.