15 App Structure & Lifecycle questions from the FastAPI bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.
Free to start: the 2-minute IT readiness check — six questions and a result.
A.an async context manager passed to the app that runs setup before serving and teardown after the last request
B.the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
C.the central object created from the FastAPI class that holds routes, configuration, and exposes the ASGI callable
D.the companion library that loads configuration from environment variables and dotenv files into a typed settings model
Answer + AI explanation with Pro
2. Which term means: "an async context manager passed to the app that runs setup before serving and teardown after the last request"?
Mid
A.Startup and shutdown events
B.pydantic-settings
C.FastAPI application instance
D.Lifespan handler
Answer + AI explanation with Pro
3. Which statement is correct?
Mid
A.Lifespan handler — an async context manager passed to the app that runs setup before serving and teardown after the last request
B.Lifespan handler — the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
C.Lifespan handler — the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
D.Lifespan handler — the companion library that loads configuration from environment variables and dotenv files into a typed settings model
Answer + AI explanation with Pro
4. What is Startup and shutdown events?
Mid
A.an async context manager passed to the app that runs setup before serving and teardown after the last request
B.the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
C.the companion library that loads configuration from environment variables and dotenv files into a typed settings model
D.the central object created from the FastAPI class that holds routes, configuration, and exposes the ASGI callable
Answer + AI explanation with Pro
5. Which term means: "the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach"?
Mid
A.FastAPI application instance
B.Lifespan handler
C.include_router
D.Startup and shutdown events
Answer + AI explanation with Pro
6. Which statement is correct?
Mid
A.Startup and shutdown events — the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
B.Startup and shutdown events — the companion library that loads configuration from environment variables and dotenv files into a typed settings model
C.Startup and shutdown events — an async context manager passed to the app that runs setup before serving and teardown after the last request
D.Startup and shutdown events — the central object created from the FastAPI class that holds routes, configuration, and exposes the ASGI callable
Answer + AI explanation with Pro
7. What is pydantic-settings?
Mid
A.an async context manager passed to the app that runs setup before serving and teardown after the last request
B.the companion library that loads configuration from environment variables and dotenv files into a typed settings model
C.the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
D.the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
Answer + AI explanation with Pro
8. Which term means: "the companion library that loads configuration from environment variables and dotenv files into a typed settings model"?
Mid
A.Startup and shutdown events
B.include_router
C.Lifespan handler
D.pydantic-settings
Answer + AI explanation with Pro
9. Which statement is correct?
Mid
A.pydantic-settings — an async context manager passed to the app that runs setup before serving and teardown after the last request
B.pydantic-settings — the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
C.pydantic-settings — the companion library that loads configuration from environment variables and dotenv files into a typed settings model
D.pydantic-settings — the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
Answer + AI explanation with Pro
10. What is include_router?
Mid
A.the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
B.an async context manager passed to the app that runs setup before serving and teardown after the last request
C.the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
D.the companion library that loads configuration from environment variables and dotenv files into a typed settings model
Answer + AI explanation with Pro
11. Which term means: "the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies"?
Mid
A.Startup and shutdown events
B.pydantic-settings
C.FastAPI application instance
D.include_router
Answer + AI explanation with Pro
12. Which statement is correct?
Mid
A.include_router — the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
B.include_router — the companion library that loads configuration from environment variables and dotenv files into a typed settings model
C.include_router — an async context manager passed to the app that runs setup before serving and teardown after the last request
D.include_router — the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
Answer + AI explanation with Pro
13. What is FastAPI application instance?
Junior
A.the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
B.the central object created from the FastAPI class that holds routes, configuration, and exposes the ASGI callable
C.the companion library that loads configuration from environment variables and dotenv files into a typed settings model
D.the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
Answer + AI explanation with Pro
14. Which term means: "the central object created from the FastAPI class that holds routes, configuration, and exposes the ASGI callable"?
Junior
A.include_router
B.pydantic-settings
C.Startup and shutdown events
D.FastAPI application instance
Answer + AI explanation with Pro
15. Which statement is correct?
Junior
A.FastAPI application instance — the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
B.FastAPI application instance — the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
C.FastAPI application instance — the central object created from the FastAPI class that holds routes, configuration, and exposes the ASGI callable
D.FastAPI application instance — the companion library that loads configuration from environment variables and dotenv files into a typed settings model
Answer + AI explanation with Pro
Free to start
Start with a free readiness check
Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every App Structure & Lifecycle question come with Pro.