PythonFan.org
Toggle Menu
Home
Online Python Compiler
Tutorials
Python FastAPI
Python Pandas
Python PyTorch
Python Seaborn
Blog
All Posts
Python API Development With FastAPI
A complete test on designing,deploying,and testing APIs.
1. Which class is used to create a FastAPI application instance?
FastAPI
App
APICreator
FastApp
2. FastAPI is built on top of the Starlette framework.
True
False
3. What is the default HTTP port number when running a FastAPI application with uvicorn?
4. Which of the following are automatically generated by FastAPI? (Select all that apply)
Swagger UI documentation
ReDoc documentation
GraphQL playground
Admin dashboard
5. Which decorator is used to define a GET endpoint in FastAPI?
@app.get
@get.route
@fastapi.get
@get_endpoint
6. Pydantic models are optional when defining request bodies in FastAPI.
True
False
7. What is the name of the tool provided by FastAPI for testing endpoints programmatically (imported from fastapi.testclient)?
8. Which parameter types are supported by FastAPI? (Select all that apply)
Path parameters
Query parameters
Body parameters
Cookie parameters
9. In FastAPI, path parameters are specified using which syntax in the route decorator?
{param}
<param>
[param]
(param)
10. FastAPI requires Python 3.7 or higher to run.
True
False
11. What argument in a route decorator specifies the response model for an endpoint?
12. Which ASGI server is commonly used to run FastAPI applications?
uvicorn
gunicorn
waitress
mod_wsgi
13. Which return types are valid for a FastAPI endpoint? (Select all that apply)
Pydantic model
dict
list
str
14. FastAPI's dependency injection system allows reusing code across multiple endpoints.
True
False
15. What is the URL path for the ReDoc documentation interface in a default FastAPI setup?
16. Which status constant represents 'Created' in FastAPI's status module?
status.HTTP_201_CREATED
status.HTTP_200_OK
status.HTTP_404_NOT_FOUND
status.HTTP_500_INTERNAL_SERVER_ERROR
17. FastAPI automatically handles CORS without additional configuration.
True
False
18. Which features make FastAPI suitable for building APIs? (Select all that apply)
Automatic request validation
Asynchronous endpoint support
Built-in ORM
Interactive documentation
19. What is the default response format for FastAPI endpoints?
20. Which is NOT a core dependency of FastAPI?
Starlette
Pydantic
Django
typing-extensions
Reset
Answered 0 of 0 — 0 correct