All quizzes
Free quiz · 50 questions in the bank

FastAPI quiz

Test your FastAPI knowledge with a free interactive quiz — 50 questions with answers and explanations. No signup needed to play.

Question 1/12Score 0

How do you set the HTTP status code returned by an endpoint?

In this round
  1. How do you set the HTTP status code returned by an endpoint?
  2. Which command runs a FastAPI app in development with auto-reload?
  3. What is the recommended way to share resources like DB sessions between endpoints?
  4. Which decorator declares a GET endpoint at `/items`?
  5. How do you accept a cookie value?
  6. Which two function definition keywords does FastAPI support for endpoints?
  7. How do you read a JSON body without a Pydantic model?
  8. Which Pydantic field declaration would you use to validate that `age` is non-negative?
  9. How do you read a request header named `X-Token`?
  10. How do you serve static files from a directory?
  11. What does `tags=["users"]` in a route decorator do?
  12. What does the `response_model` argument do?
Gaps to close?
Read the curated FastAPI notes — core concepts, patterns, interview prep.
FastAPI notes

More quizzes

AccessibilityAlgorithmsAngularApache KafkaAWSBootstrap