App Structure & Lifecycle interview questions

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.

Take the free IT readiness check

or take a mock interview set up for this area

1. What is Lifespan handler?

Mid
  1. A.an async context manager passed to the app that runs setup before serving and teardown after the last request
  2. B.the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
  3. C.the central object created from the FastAPI class that holds routes, configuration, and exposes the ASGI callable
  4. 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
  1. A.Startup and shutdown events
  2. B.pydantic-settings
  3. C.FastAPI application instance
  4. D.Lifespan handler

Answer + AI explanation with Pro

3. Which statement is correct?

Mid
  1. A.Lifespan handler — an async context manager passed to the app that runs setup before serving and teardown after the last request
  2. B.Lifespan handler — the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
  3. C.Lifespan handler — the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
  4. 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
  1. A.an async context manager passed to the app that runs setup before serving and teardown after the last request
  2. B.the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
  3. C.the companion library that loads configuration from environment variables and dotenv files into a typed settings model
  4. 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
  1. A.FastAPI application instance
  2. B.Lifespan handler
  3. C.include_router
  4. D.Startup and shutdown events

Answer + AI explanation with Pro

6. Which statement is correct?

Mid
  1. 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
  2. B.Startup and shutdown events — the companion library that loads configuration from environment variables and dotenv files into a typed settings model
  3. C.Startup and shutdown events — an async context manager passed to the app that runs setup before serving and teardown after the last request
  4. 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
  1. A.an async context manager passed to the app that runs setup before serving and teardown after the last request
  2. B.the companion library that loads configuration from environment variables and dotenv files into a typed settings model
  3. C.the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
  4. 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
  1. A.Startup and shutdown events
  2. B.include_router
  3. C.Lifespan handler
  4. D.pydantic-settings

Answer + AI explanation with Pro

9. Which statement is correct?

Mid
  1. A.pydantic-settings — an async context manager passed to the app that runs setup before serving and teardown after the last request
  2. B.pydantic-settings — the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
  3. C.pydantic-settings — the companion library that loads configuration from environment variables and dotenv files into a typed settings model
  4. 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
  1. A.the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
  2. B.an async context manager passed to the app that runs setup before serving and teardown after the last request
  3. C.the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
  4. 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
  1. A.Startup and shutdown events
  2. B.pydantic-settings
  3. C.FastAPI application instance
  4. D.include_router

Answer + AI explanation with Pro

12. Which statement is correct?

Mid
  1. A.include_router — the older event hooks for running code when the application boots and when it stops, now superseded by the lifespan approach
  2. B.include_router — the companion library that loads configuration from environment variables and dotenv files into a typed settings model
  3. C.include_router — an async context manager passed to the app that runs setup before serving and teardown after the last request
  4. 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
  1. A.the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
  2. B.the central object created from the FastAPI class that holds routes, configuration, and exposes the ASGI callable
  3. C.the companion library that loads configuration from environment variables and dotenv files into a typed settings model
  4. 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
  1. A.include_router
  2. B.pydantic-settings
  3. C.Startup and shutdown events
  4. D.FastAPI application instance

Answer + AI explanation with Pro

15. Which statement is correct?

Junior
  1. 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
  2. B.FastAPI application instance — the application method that mounts a router's endpoints, optionally adding a shared prefix, tags, and dependencies
  3. C.FastAPI application instance — the central object created from the FastAPI class that holds routes, configuration, and exposes the ASGI callable
  4. 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.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers