All fields

“Route Constraints & Templates” in Information Technology

27 questions across 1 technology.

Information Technology

27 questions in 1 technology

#QuestionTechnologyTopicLevel
1How would you implement route-based API versioning using route templates and constraints without a dedicated versioning library? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesAdvanced
2How do route constraints (like {id:int} or {id:guid}) restrict which requests match a given route, and why are they useful? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesIntermediate
3What is a route template in ASP.NET Core, and how do route parameters like {id} work within one? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesBeginner
4What is endpoint metadata, and how do attributes like [Authorize] and custom metadata attach to a specific route for later inspection by middleware? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesIntermediate
5How does route template precedence work when multiple routes could potentially match the same incoming URL? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesIntermediate
6How do you define optional route parameters, and what's the difference between an optional parameter and one with a default value? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesIntermediate
7What is route grouping via MapGroup, and how does it let you apply shared route prefixes, metadata, and filters to a set of related minimal API endpoints? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesIntermediate
8How do route parameter transformers let you customize the casing convention of generated URLs, such as converting PascalCase action names to kebab-case URLs? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesIntermediate
9How do complex/composite route segments (combining literal text and a parameter in the same segment, like {fileName}.{extension}) work? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesIntermediate
10How would you implement a custom route constraint (IRouteConstraint) for a domain-specific validation pattern, like a product SKU format? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesAdvanced
11How do you write custom middleware or an endpoint filter that reads endpoint metadata to conditionally alter its behavior per-route? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesAdvanced
12How would you implement a catch-all route parameter to handle a variable-depth URL path, like a file browser or wiki-style page hierarchy? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesAdvanced
13How do you generate a URL for a named route or endpoint programmatically, rather than hardcoding URL strings throughout the application (like in a Location header for a 201 Created response)? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesAdvanced
14How would you debug why a specific request isn't matching the route you expect it to, using ASP.NET Core's routing diagnostics? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesAdvanced
15How would you design a route structure and constraint strategy for a large, RESTful API with deeply nested resource hierarchies (like organizations/{orgId}/projects/{projectId}/tasks/{taskId})? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesAdvanced
16How does route-to-code discoverability differ between controllers' attribute-based routing and minimal APIs' explicit registration, and what are the trade-offs for large codebases? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsIntermediate
17What is the fundamental structural difference between controller-based APIs (MVC) and minimal APIs in ASP.NET Core? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsBeginner
18How do you organize and group endpoints in Swagger UI by tags or API version? ASP.NET Core › API Documentation with Swagger/OpenAPIASP.NET CoreAPI Documentation with Swagger/OpenAPIIntermediate
19What is the difference between versioning at the API level (entire controller/group) versus versioning individual actions within a shared controller? ASP.NET Core › API VersioningASP.NET CoreAPI VersioningIntermediate
20How do you restrict access to a minimal API endpoint or endpoint group using authorization, given minimal APIs don't use controller attributes? ASP.NET Core › AuthorizationASP.NET CoreAuthorizationIntermediate
21How does the [Authorize] attribute interact with Razor Pages, given they don't use the traditional controller/action model? ASP.NET Core › AuthorizationASP.NET CoreAuthorizationIntermediate
22How do you organize a large number of minimal API endpoints without ending up with an enormous, unwieldy Program.cs file? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsIntermediate
23Can a single ASP.NET Core project use both controllers and minimal APIs simultaneously, and what are valid reasons to do so? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsIntermediate
24How would you exclude specific endpoints or entire controllers from appearing in the generated Swagger documentation? ASP.NET Core › API Documentation with Swagger/OpenAPIASP.NET CoreAPI Documentation with Swagger/OpenAPIAdvanced
25How does the underlying request execution pipeline differ in performance between controllers and minimal APIs, and what accounts for the difference? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsAdvanced
26How would you decide between controllers and minimal APIs for a new project, weighing team familiarity, project complexity, and long-term maintainability? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsAdvanced
27How does CORS interact with an API gateway or reverse proxy sitting in front of multiple backend microservices? ASP.NET Core › CORS (Cross-Origin Resource Sharing)ASP.NET CoreCORS (Cross-Origin Resource Sharing)Advanced