18 Dependency Injection 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.a dependency that itself declares Depends on another, forming a resolved chain of providers
B.the marker that declares a callable whose result the framework resolves and injects as a handler argument
C.the option set to False on Depends to force a provider to re-run rather than reuse its cached per-request result
D.a provider written as a generator that yields a value and runs teardown code after the response, ideal for closing a database session
Answer + AI explanation with Pro
2. Which term means: "the marker that declares a callable whose result the framework resolves and injects as a handler argument"?
Junior
A.Path operation dependencies list
B.Depends
C.Yield dependency
D.Sub-dependency
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.Depends — a provider written as a generator that yields a value and runs teardown code after the response, ideal for closing a database session
B.Depends — the option set to False on Depends to force a provider to re-run rather than reuse its cached per-request result
C.Depends — the marker that declares a callable whose result the framework resolves and injects as a handler argument
D.Depends — the decorator argument that runs providers for their side effects, such as auth checks, without injecting their return value
Answer + AI explanation with Pro
4. What is Sub-dependency?
Mid
A.the option set to False on Depends to force a provider to re-run rather than reuse its cached per-request result
B.the marker that declares a callable whose result the framework resolves and injects as a handler argument
C.a provider written as a generator that yields a value and runs teardown code after the response, ideal for closing a database session
D.a dependency that itself declares Depends on another, forming a resolved chain of providers
Answer + AI explanation with Pro
5. Which term means: "a dependency that itself declares Depends on another, forming a resolved chain of providers"?
Mid
A.Depends
B.Yield dependency
C.Sub-dependency
D.use_cache disabled
Answer + AI explanation with Pro
6. Which statement is correct?
Mid
A.Sub-dependency — a dependency that itself declares Depends on another, forming a resolved chain of providers
B.Sub-dependency — the default behavior where a provider called more than once in a single request is executed only once and its result reused
C.Sub-dependency — the marker that declares a callable whose result the framework resolves and injects as a handler argument
D.Sub-dependency — the option set to False on Depends to force a provider to re-run rather than reuse its cached per-request result
Answer + AI explanation with Pro
7. What is Per-request dependency caching?
Mid
A.the default behavior where a provider called more than once in a single request is executed only once and its result reused
B.a dependency that itself declares Depends on another, forming a resolved chain of providers
C.the option set to False on Depends to force a provider to re-run rather than reuse its cached per-request result
D.a provider written as a generator that yields a value and runs teardown code after the response, ideal for closing a database session
Answer + AI explanation with Pro
8. Which term means: "the default behavior where a provider called more than once in a single request is executed only once and its result reused"?
Mid
A.Path operation dependencies list
B.Sub-dependency
C.Yield dependency
D.Per-request dependency caching
Answer + AI explanation with Pro
9. Which statement is correct?
Mid
A.Per-request dependency caching — the decorator argument that runs providers for their side effects, such as auth checks, without injecting their return value
B.Per-request dependency caching — the marker that declares a callable whose result the framework resolves and injects as a handler argument
C.Per-request dependency caching — the default behavior where a provider called more than once in a single request is executed only once and its result reused
D.Per-request dependency caching — a dependency that itself declares Depends on another, forming a resolved chain of providers
Answer + AI explanation with Pro
10. What is Yield dependency?
Senior
A.the default behavior where a provider called more than once in a single request is executed only once and its result reused
B.a provider written as a generator that yields a value and runs teardown code after the response, ideal for closing a database session
C.the decorator argument that runs providers for their side effects, such as auth checks, without injecting their return value
D.a dependency that itself declares Depends on another, forming a resolved chain of providers
Answer + AI explanation with Pro
11. Which term means: "a provider written as a generator that yields a value and runs teardown code after the response, ideal for closing a database session"?
Senior
A.Yield dependency
B.Per-request dependency caching
C.Sub-dependency
D.use_cache disabled
Answer + AI explanation with Pro
12. Which statement is correct?
Senior
A.Yield dependency — the decorator argument that runs providers for their side effects, such as auth checks, without injecting their return value
B.Yield dependency — a dependency that itself declares Depends on another, forming a resolved chain of providers
C.Yield dependency — the option set to False on Depends to force a provider to re-run rather than reuse its cached per-request result
D.Yield dependency — a provider written as a generator that yields a value and runs teardown code after the response, ideal for closing a database session
Answer + AI explanation with Pro
13. What is Path operation dependencies list?
Mid
A.the decorator argument that runs providers for their side effects, such as auth checks, without injecting their return value
B.a dependency that itself declares Depends on another, forming a resolved chain of providers
C.the default behavior where a provider called more than once in a single request is executed only once and its result reused
D.a provider written as a generator that yields a value and runs teardown code after the response, ideal for closing a database session
Answer + AI explanation with Pro
14. Which term means: "the decorator argument that runs providers for their side effects, such as auth checks, without injecting their return value"?
Mid
A.Path operation dependencies list
B.Depends
C.use_cache disabled
D.Per-request dependency caching
Answer + AI explanation with Pro
15. Which statement is correct?
Mid
A.Path operation dependencies list — the marker that declares a callable whose result the framework resolves and injects as a handler argument
B.Path operation dependencies list — the decorator argument that runs providers for their side effects, such as auth checks, without injecting their return value
C.Path operation dependencies list — a provider written as a generator that yields a value and runs teardown code after the response, ideal for closing a database session
D.Path operation dependencies list — the default behavior where a provider called more than once in a single request is executed only once and its result reused
Answer + AI explanation with Pro
16. What is use_cache disabled?
Senior
A.the option set to False on Depends to force a provider to re-run rather than reuse its cached per-request result
B.a dependency that itself declares Depends on another, forming a resolved chain of providers
C.the default behavior where a provider called more than once in a single request is executed only once and its result reused
D.the marker that declares a callable whose result the framework resolves and injects as a handler argument
Answer + AI explanation with Pro
17. Which term means: "the option set to False on Depends to force a provider to re-run rather than reuse its cached per-request result"?
Senior
A.Sub-dependency
B.use_cache disabled
C.Per-request dependency caching
D.Depends
Answer + AI explanation with Pro
18. Which statement is correct?
Senior
A.use_cache disabled — a provider written as a generator that yields a value and runs teardown code after the response, ideal for closing a database session
B.use_cache disabled — the option set to False on Depends to force a provider to re-run rather than reuse its cached per-request result
C.use_cache disabled — a dependency that itself declares Depends on another, forming a resolved chain of providers
D.use_cache disabled — the marker that declares a callable whose result the framework resolves and injects as a handler argument
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 Dependency Injection question come with Pro.