Routing & Path Operations interview questions

21 real Routing & Path Operations questions from the FastAPI bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is Path operation decorator?

Junior
  1. A.a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
  2. B.a class for grouping related endpoints in a separate module, later attached to the main application with include_router
  3. 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
  4. D.a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories
Reveal the answer + AI explanation — free account

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
  1. A.Route ordering
  2. B.Path parameter
  3. C.Path operation decorator
  4. D.Query parameter
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. 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
  2. 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
  3. 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
  4. 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
Reveal the answer + AI explanation — free account

4. What is Path parameter?

Junior
  1. A.a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
  2. 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
  3. C.a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
  4. D.a class for grouping related endpoints in a separate module, later attached to the main application with include_router
Reveal the answer + AI explanation — free account

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
  1. A.Route ordering
  2. B.status_code argument
  3. C.Path parameter
  4. D.Path converter
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Junior
  1. A.Path parameter — the decorator option that sets the default HTTP status returned on a successful response, for example 201 for a created resource
  2. B.Path parameter — a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
  3. C.Path parameter — a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories
  4. 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
Reveal the answer + AI explanation — free account

7. What is Query parameter?

Junior
  1. A.a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
  2. B.the decorator option that sets the default HTTP status returned on a successful response, for example 201 for a created resource
  3. 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
  4. D.a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
Reveal the answer + AI explanation — free account

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
  1. A.Query parameter
  2. B.status_code argument
  3. C.APIRouter
  4. D.Path converter
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Junior
  1. A.Query parameter — a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
  2. B.Query parameter — a class for grouping related endpoints in a separate module, later attached to the main application with include_router
  3. 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
  4. 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
Reveal the answer + AI explanation — free account

10. What is Path converter?

Mid
  1. A.a class for grouping related endpoints in a separate module, later attached to the main application with include_router
  2. B.a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
  3. C.a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
  4. D.a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories
Reveal the answer + AI explanation — free account

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
  1. A.Query parameter
  2. B.Path converter
  3. C.Path operation decorator
  4. D.APIRouter
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. 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
  2. B.Path converter — a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories
  3. C.Path converter — the decorator option that sets the default HTTP status returned on a successful response, for example 201 for a created resource
  4. D.Path converter — a class for grouping related endpoints in a separate module, later attached to the main application with include_router
Reveal the answer + AI explanation — free account

13. What is status_code argument?

Junior
  1. A.a class for grouping related endpoints in a separate module, later attached to the main application with include_router
  2. B.a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
  3. 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
  4. D.the decorator option that sets the default HTTP status returned on a successful response, for example 201 for a created resource
Reveal the answer + AI explanation — free account

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
  1. A.Query parameter
  2. B.status_code argument
  3. C.Path operation decorator
  4. D.APIRouter
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Junior
  1. 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
  2. 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
  3. C.status_code argument — a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories
  4. 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
Reveal the answer + AI explanation — free account

16. What is APIRouter?

Mid
  1. A.a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
  2. B.a class for grouping related endpoints in a separate module, later attached to the main application with include_router
  3. 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
  4. D.a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
Reveal the answer + AI explanation — free account

17. Which term means: "a class for grouping related endpoints in a separate module, later attached to the main application with include_router"?

Mid
  1. A.Path operation decorator
  2. B.APIRouter
  3. C.Route ordering
  4. D.Path converter
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Mid
  1. A.APIRouter — a type annotation in a route segment such as :path that lets a captured value contain slashes and span subdirectories
  2. 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
  3. C.APIRouter — a decorator such as @app.get or @app.post that binds an HTTP method and a URL path to a handler function
  4. D.APIRouter — a class for grouping related endpoints in a separate module, later attached to the main application with include_router
Reveal the answer + AI explanation — free account

19. What is Route ordering?

Mid
  1. A.the decorator option that sets the default HTTP status returned on a successful response, for example 201 for a created resource
  2. B.a value captured from a placeholder in the URL like /items/{id} and passed as a named argument to the handler
  3. C.a class for grouping related endpoints in a separate module, later attached to the main application with include_router
  4. 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
Reveal the answer + AI explanation — free account

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
  1. A.Query parameter
  2. B.Path operation decorator
  3. C.APIRouter
  4. D.Route ordering
Reveal the answer + AI explanation — free account

21. Which statement is correct?

Mid
  1. 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
  2. B.Route ordering — a class for grouping related endpoints in a separate module, later attached to the main application with include_router
  3. 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
  4. 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
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Routing & Path Operations free