Interview frequency: …
Short answer
Minimal APIs map routes directly through lightweight Lambdas with less overhead and faster startup, while Controllers provide a traditional structure suited to large, complex projects.
Explanation
Minimal APIs were designed for high performance and fast startup without the overhead of classic MVC features (such as complex Model Binders and heavy filters), making them ideal for Microservices and Serverless functions. ControllerBase classes provide a complete structure for large projects with broad support for Action Filters and Model Conventions.
Code example
// Minimal API (Program.cs)
var app = builder.Build();
app.MapGet("/users/{id}", async (int id, IUserService service) =>
await service.GetUserAsync(id) is { } user ? Results.Ok(user) : Results.NotFound());Common mistakes
- Putting hundreds of routes and their logic directly in Program.cs for Minimal APIs instead of organizing them into extensible classes (Endpoint Route Groups).