21 Routing & Path Operations 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 decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
B.a class for grouping related endpoints in a separate module, later attached to the main application with include_router
C.the rule that endpoints are matched top to bottom, so a fixed path must be declared before a variable one to avoid being shadowed
D.a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories
Answer + AI explanation with Pro
2. Which term means: "a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function"?
Junior
A.Route ordering
B.Path parameter
C.Path operation decorator
D.Query parameter
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.Path operation decorator — the rule that endpoints are matched top to bottom, so a fixed path must be declared before a variable one to avoid being shadowed
B.Path operation decorator — a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
C.Path operation decorator — a value taken from the part of the URL after the question mark that maps to a function argument not present in the path
D.Path operation decorator — a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
Answer + AI explanation with Pro
4. What is Path parameter?
Junior
A.a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
B.a value taken from the part of the URL after the question mark that maps to a function argument not present in the path
C.a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
D.a class for grouping related endpoints in a separate module, later attached to the main application with include_router
Answer + AI explanation with Pro
5. Which term means: "a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler"?
Junior
A.Route ordering
B.status_code argument
C.Path parameter
D.Path converter
Answer + AI explanation with Pro
6. Which statement is correct?
Junior
A.Path parameter — the decorator option that sets the default HTTP status returned on a successful response, for example 201 for a created resource
B.Path parameter — a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
C.Path parameter — a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories
D.Path parameter — the rule that endpoints are matched top to bottom, so a fixed path must be declared before a variable one to avoid being shadowed
Answer + AI explanation with Pro
7. What is Query parameter?
Junior
A.a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
B.the decorator option that sets the default HTTP status returned on a successful response, for example 201 for a created resource
C.a value taken from the part of the URL after the question mark that maps to a function argument not present in the path
D.a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
Answer + AI explanation with Pro
8. Which term means: "a value taken from the part of the URL after the question mark that maps to a function argument not present in the path"?
Junior
A.Query parameter
B.status_code argument
C.APIRouter
D.Path converter
Answer + AI explanation with Pro
9. Which statement is correct?
Junior
A.Query parameter — a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
B.Query parameter — a class for grouping related endpoints in a separate module, later attached to the main application with include_router
C.Query parameter — a value taken from the part of the URL after the question mark that maps to a function argument not present in the path
D.Query parameter — the rule that endpoints are matched top to bottom, so a fixed path must be declared before a variable one to avoid being shadowed
Answer + AI explanation with Pro
10. What is Path converter?
Mid
A.a class for grouping related endpoints in a separate module, later attached to the main application with include_router
B.a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
C.a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
D.a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories
Answer + AI explanation with Pro
11. Which term means: "a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories"?
Mid
A.Query parameter
B.Path converter
C.Path operation decorator
D.APIRouter
Answer + AI explanation with Pro
12. Which statement is correct?
Mid
A.Path converter — the rule that endpoints are matched top to bottom, so a fixed path must be declared before a variable one to avoid being shadowed
B.Path converter — a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories
C.Path converter — the decorator option that sets the default HTTP status returned on a successful response, for example 201 for a created resource
D.Path converter — a class for grouping related endpoints in a separate module, later attached to the main application with include_router
Answer + AI explanation with Pro
13. What is status_code argument?
Junior
A.a class for grouping related endpoints in a separate module, later attached to the main application with include_router
B.a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
C.the rule that endpoints are matched top to bottom, so a fixed path must be declared before a variable one to avoid being shadowed
D.the decorator option that sets the default HTTP status returned on a successful response, for example 201 for a created resource
Answer + AI explanation with Pro
14. Which term means: "the decorator option that sets the default HTTP status returned on a successful response, for example 201 for a created resource"?
Junior
A.Query parameter
B.status_code argument
C.Path operation decorator
D.APIRouter
Answer + AI explanation with Pro
15. Which statement is correct?
Junior
A.status_code argument — a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
B.status_code argument — the decorator option that sets the default HTTP status returned on a successful response, for example 201 for a created resource
C.status_code argument — a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories
D.status_code argument — a value taken from the part of the URL after the question mark that maps to a function argument not present in the path
Answer + AI explanation with Pro
16. What is APIRouter?
Mid
A.a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
B.a class for grouping related endpoints in a separate module, later attached to the main application with include_router
C.the rule that endpoints are matched top to bottom, so a fixed path must be declared before a variable one to avoid being shadowed
D.a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
Answer + AI explanation with Pro
17. Which term means: "a class for grouping related endpoints in a separate module, later attached to the main application with include_router"?
Mid
A.Path operation decorator
B.APIRouter
C.Route ordering
D.Path converter
Answer + AI explanation with Pro
18. Which statement is correct?
Mid
A.APIRouter — a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories
B.APIRouter — a value taken from the part of the URL after the question mark that maps to a function argument not present in the path
C.APIRouter — a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
D.APIRouter — a class for grouping related endpoints in a separate module, later attached to the main application with include_router
Answer + AI explanation with Pro
19. What is Route ordering?
Mid
A.the decorator option that sets the default HTTP status returned on a successful response, for example 201 for a created resource
B.a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
C.a class for grouping related endpoints in a separate module, later attached to the main application with include_router
D.the rule that endpoints are matched top to bottom, so a fixed path must be declared before a variable one to avoid being shadowed
Answer + AI explanation with Pro
20. Which term means: "the rule that endpoints are matched top to bottom, so a fixed path must be declared before a variable one to avoid being shadowed"?
Mid
A.Query parameter
B.Path operation decorator
C.APIRouter
D.Route ordering
Answer + AI explanation with Pro
21. Which statement is correct?
Mid
A.Route ordering — a value taken from the part of the URL after the question mark that maps to a function argument not present in the path
B.Route ordering — a class for grouping related endpoints in a separate module, later attached to the main application with include_router
C.Route ordering — a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
D.Route ordering — the rule that endpoints are matched top to bottom, so a fixed path must be declared before a variable one to avoid being shadowed
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 Routing & Path Operations question come with Pro.