FastAPI

FastAPI

Test your FastAPI knowledge with free quizzes on MyCodeSkills covering core concepts.


  1. What is the main purpose of FastAPI?

    • Data Science
    • Web Development
    • Game Development
    • Mobile App Development
  2. FastAPI is built on top of which web framework?

    • Flask
    • Tornado
    • Starlette
    • Django
  3. What command is used to install FastAPI?

    • pip install fastapi
    • npm install fastapi
    • pip3 fastapi
    • python fastapi
  4. What server is commonly used with FastAPI?

    • Gunicorn
    • Apache
    • Nginx
    • Uvicorn
  5. Which method is used for creating a GET route in FastAPI?

    • @app.route()
    • @app.get()
    • @app.fetch()
    • @app.url()
  6. What feature in FastAPI allows injecting shared logic into endpoints?

    • Middleware
    • Dependency Injection
    • Event Hooks
    • Blueprint
  7. Which keyword is used to define asynchronous functions in FastAPI?

    • async
    • await
    • def
    • yield
  8. How does FastAPI handle multiple route files for large applications?

    • Using Controllers
    • Using Path Functions
    • Using Blueprints
    • Using APIRouter
  9. What is the default response format for FastAPI?

    • HTML
    • JSON
    • XML
    • YAML
  10. Which class is used to define background tasks in FastAPI?

    • Thread
    • BackgroundWorker
    • BackgroundTasks
    • AsyncTask
  11. What does Depends() in FastAPI help with?

    • Routing
    • Dependency Injection
    • Middleware
    • Template Rendering
  12. Which method is used to implement background tasks in FastAPI?

    • @fastapi.background()
    • BackgroundTask()
    • start_task()
    • run_async()
  13. How can FastAPI handle JWT authentication?

    • Using JWTBearer class
    • Using OAuth1PasswordBearer
    • Using TokenPasser
    • FastAPI has no JWT support
  14. What does the WebSocketRoute allow in FastAPI?

    • File uploads
    • OAuth2 login
    • Real-time communication
    • Static file serving
  15. FastAPI supports asynchronous calls using which of the following keywords?

    • async/await
    • defer/sync
    • yield/return
    • thread/join