15 Errors & Middleware 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.the parameter used to schedule work that runs after the response is sent, such as sending an email
B.a layer that wraps every request and response, useful for logging, timing, or attaching headers across all endpoints
C.the component that adds cross-origin headers so browsers permit requests from other configured domains
D.a function registered to catch a given exception type globally and convert it into a formatted response
Answer + AI explanation with Pro
2. Which term means: "a function registered to catch a given exception type globally and convert it into a formatted response"?
Mid
A.BackgroundTasks
B.RequestValidationError
C.Exception handler
D.CORS middleware
Answer + AI explanation with Pro
3. Which statement is correct?
Mid
A.Exception handler — a layer that wraps every request and response, useful for logging, timing, or attaching headers across all endpoints
B.Exception handler — a function registered to catch a given exception type globally and convert it into a formatted response
C.Exception handler — the error raised when incoming data fails schema checks, returned by default as a 422 with details of each invalid field
D.Exception handler — the parameter used to schedule work that runs after the response is sent, such as sending an email
Answer + AI explanation with Pro
4. What is Middleware?
Mid
A.the error raised when incoming data fails schema checks, returned by default as a 422 with details of each invalid field
B.a layer that wraps every request and response, useful for logging, timing, or attaching headers across all endpoints
C.the component that adds cross-origin headers so browsers permit requests from other configured domains
D.the parameter used to schedule work that runs after the response is sent, such as sending an email
Answer + AI explanation with Pro
5. Which term means: "a layer that wraps every request and response, useful for logging, timing, or attaching headers across all endpoints"?
Mid
A.CORS middleware
B.BackgroundTasks
C.Middleware
D.RequestValidationError
Answer + AI explanation with Pro
6. Which statement is correct?
Mid
A.Middleware — the error raised when incoming data fails schema checks, returned by default as a 422 with details of each invalid field
B.Middleware — the component that adds cross-origin headers so browsers permit requests from other configured domains
C.Middleware — a layer that wraps every request and response, useful for logging, timing, or attaching headers across all endpoints
D.Middleware — the parameter used to schedule work that runs after the response is sent, such as sending an email
Answer + AI explanation with Pro
7. What is CORS middleware?
Mid
A.a layer that wraps every request and response, useful for logging, timing, or attaching headers across all endpoints
B.the component that adds cross-origin headers so browsers permit requests from other configured domains
C.the parameter used to schedule work that runs after the response is sent, such as sending an email
D.a function registered to catch a given exception type globally and convert it into a formatted response
Answer + AI explanation with Pro
8. Which term means: "the component that adds cross-origin headers so browsers permit requests from other configured domains"?
Mid
A.BackgroundTasks
B.Middleware
C.CORS middleware
D.Exception handler
Answer + AI explanation with Pro
9. Which statement is correct?
Mid
A.CORS middleware — the error raised when incoming data fails schema checks, returned by default as a 422 with details of each invalid field
B.CORS middleware — a function registered to catch a given exception type globally and convert it into a formatted response
C.CORS middleware — the component that adds cross-origin headers so browsers permit requests from other configured domains
D.CORS middleware — a layer that wraps every request and response, useful for logging, timing, or attaching headers across all endpoints
Answer + AI explanation with Pro
10. What is BackgroundTasks?
Mid
A.a layer that wraps every request and response, useful for logging, timing, or attaching headers across all endpoints
B.the parameter used to schedule work that runs after the response is sent, such as sending an email
C.the component that adds cross-origin headers so browsers permit requests from other configured domains
D.the error raised when incoming data fails schema checks, returned by default as a 422 with details of each invalid field
Answer + AI explanation with Pro
11. Which term means: "the parameter used to schedule work that runs after the response is sent, such as sending an email"?
Mid
A.Exception handler
B.BackgroundTasks
C.CORS middleware
D.RequestValidationError
Answer + AI explanation with Pro
12. Which statement is correct?
Mid
A.BackgroundTasks — a layer that wraps every request and response, useful for logging, timing, or attaching headers across all endpoints
B.BackgroundTasks — the error raised when incoming data fails schema checks, returned by default as a 422 with details of each invalid field
C.BackgroundTasks — a function registered to catch a given exception type globally and convert it into a formatted response
D.BackgroundTasks — the parameter used to schedule work that runs after the response is sent, such as sending an email
Answer + AI explanation with Pro
13. What is RequestValidationError?
Senior
A.the error raised when incoming data fails schema checks, returned by default as a 422 with details of each invalid field
B.a function registered to catch a given exception type globally and convert it into a formatted response
C.a layer that wraps every request and response, useful for logging, timing, or attaching headers across all endpoints
D.the parameter used to schedule work that runs after the response is sent, such as sending an email
Answer + AI explanation with Pro
14. Which term means: "the error raised when incoming data fails schema checks, returned by default as a 422 with details of each invalid field"?
Senior
A.CORS middleware
B.BackgroundTasks
C.RequestValidationError
D.Exception handler
Answer + AI explanation with Pro
15. Which statement is correct?
Senior
A.RequestValidationError — the parameter used to schedule work that runs after the response is sent, such as sending an email
B.RequestValidationError — the component that adds cross-origin headers so browsers permit requests from other configured domains
C.RequestValidationError — the error raised when incoming data fails schema checks, returned by default as a 422 with details of each invalid field
D.RequestValidationError — a layer that wraps every request and response, useful for logging, timing, or attaching headers across all endpoints
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 Errors & Middleware question come with Pro.