🔥 ASP.
NET Core Web API & MVC – FINAL TOP INTERVIEW QUESTIONS
1️⃣ [Link] Core Fundamentals (MUST KNOW)
1. What is [Link] Core and why use it?
2. Difference between [Link] and [Link] Core.
3. Benefits of [Link] Core (cross-platform, performance, modular).
4. What is Kestrel?
5. What is Middleware and request pipeline?
6. [Link] vs [Link].
7. Dependency Injection (DI) — what, why, how.
8. IServiceCollection & IServiceProvider basics.
9. Environments (Development, Production, Staging).
10. [Link] and reading configurations.
2️⃣ MVC Basics
1. What is MVC architecture (Model, View, Controller)?
2. Role of Model, View, Controller.
3. When to use MVC vs Web API.
4. Controllers & IActionResult.
5. ViewResult vs JsonResult.
6. ViewBag, ViewData, TempData difference.
7. Strongly typed views.
8. Model Binding & Model Validation.
9. Routing – conventional vs attribute routing.
10. Areas in MVC.
11. Partial Views & View Components.
12. _ViewStart.cshtml and Razor syntax.
13. NonActionAttribute usage.
3️⃣ Web API Basics
1. What is Web API & REST API.
2. REST principles & statelessness.
3. HTTP Methods: GET, POST, PUT, PATCH, DELETE (idempotent & safe).
4. HTTP Status Codes: 200, 201, 204, 400, 401, 403, 404, 500.
5. Routing in Web API ([Route], [HttpGet], constraints).
6. [ApiController] benefits.
7. Model Binding in API ([FromBody], [FromQuery], [FromRoute]).
8. DTOs — why and when to use.
9. CORS – configuration and usage.
10. API Versioning – URL, query, header.
11. Swagger/OpenAPI integration & configuration.
12. Response caching ([ResponseCache]).
13. Rate limiting – basic idea and middleware.
4️⃣ Authentication & Authorization
1. Authentication vs Authorization.
2. JWT authentication – setup & flow.
3. Role-based and policy-based authorization.
4. [Authorize] & [AllowAnonymous] attributes.
5. Claims-based authorization basics.
6. OAuth2 / OpenID Connect basics.
7. HTTPS redirection middleware & security.
5️⃣ Entity Framework Core (CRUD & Relationships)
1. What is EF Core & ORM.
2. DbContext & DbSet.
3. Code First vs Database First.
4. Migrations – Add-Migration & Update-Database.
5. LINQ basics & queries (First, FirstOrDefault, Single, SingleOrDefault).
6. IQueryable vs IEnumerable.
7. Eager vs Lazy loading.
8. Tracking vs NoTracking.
9. One-to-One, One-to-Many, Many-to-Many relationships.
10. Repository & Unit of Work patterns.
6️⃣ Dependency Injection (DI) & Service Lifetimes
1. AddTransient vs AddScoped vs AddSingleton.
2. Constructor Injection example.
3. Why DI is better than creating objects manually.
4. Scoped service example in Web API.
5. Interface usage & loose coupling.
7️⃣ Middleware & Filters
1. What is middleware?
2. Custom middleware example.
3. [Link] vs [Link] vs [Link].
4. Filters – ActionFilter, ResultFilter, ExceptionFilter, AuthorizationFilter.
5. Global filters registration.
8️⃣ Error Handling & Logging
1. try-catch best practices in controllers.
2. Global exception handling via middleware.
3. ILogger usage & log levels.
4. Custom error responses.
9️⃣ Performance & Best Practices
1. Async / Await usage & non-blocking calls.
2. Caching – in-memory & distributed.
3. Pagination & search APIs.
4. DTOs & AutoMapper.
5. Avoiding N+1 query problem in EF Core.
1️⃣0️⃣ Advanced / Extra (Good to know for mid-level)
1. IHttpClientFactory – why & how to use.
2. Background tasks – IHostedService / BackgroundService.
3. Health checks – AddHealthChecks & monitoring.
4. SignalR basics for real-time communication.
5. Microservices concepts – Docker, service discovery, Polly.
6. Testing – xUnit, Moq, TestServer, controller testing.
7. Deployment – IIS, Docker, Azure basics.
1️⃣1️⃣ Practical / Coding Questions
1. CRUD Web API (Products/User)
2. Login/Register API with JWT
3. Filter + search + pagination API
4. One-to-many relationship API
5. Exception handling in API
6. Repository pattern example
7. DTO + AutoMapper implementation
8. Securing API with roles & JWT
[Link]
.NET Beginner Interview Questions – Roman English
1. What is .NET?
“.NET ek cross-platform framework hai Microsoft ka, web, desktop, mobile
aur cloud apps banane ke liye. Aap C#, F#, ya [Link] use karte ho. Code
compile hota hai CIL (Common Intermediate Language) me aur CLR
execute karta hai for cross-platform compatibility. Key components hain CLR,
Base Class Library (BCL), aur JIT compiler.”
2. What is the CLR?
“CLR yani Common Language Runtime .NET apps execute karta hai. Ye
memory manage karta hai garbage collection ke through, security handle
karta hai, aur CIL ko machine code me JIT compile karta hai. Ye tasks
automate karta hai jaise memory reclamation, jo C++ jaise languages me
manually hoti hai, isse reliability improve hoti hai.”
3. .NET Versions Differences
“.NET Framework sirf Windows ke liye hai aur legacy apps jaise WinForms ke
liye use hota hai. .NET Core cross-platform hai aur cloud/microservices ke
liye suitable hai. .NET 5+ unifies both, jaise .NET 8 LTS (2023) aur .NET 9 STS
(2024). Ye evolving needs support karta hai, desktop se leke AI/cloud tak.”
4. What is CIL?
“Common Intermediate Language (CIL) intermediate code hai jo saari .NET
languages me compile hota hai. CLR isko execute karta hai cross-platform,
aur ye language interoperability allow karta hai (jaise C# ke sath F#). JIT
compiler optimization bhi karta hai.”
5. Managed vs Unmanaged Code
“Managed code CLR ke under run hota hai, automatic memory aur security
manage hoti hai, jaise C# objects. Unmanaged code CLR ke bahar run hota
hai, jaise C++ via P/Invoke, aur manually manage karna padta hai, lekin
performance zyada hoti hai. P/Invoke ya COM Interop se integration possible
hai.”
6. Garbage Collection
“GC CLR me automatically heap memory ko mark, sweep aur compact karta
hai unused objects ke liye, memory leaks prevent karte hue. Kabhi execution
pause hota hai. Optimize karne ke liye objects reuse karo, structs use karo,
aur large allocations avoid karo.”
7. Value vs Reference Types
“Value types (int, struct) data directly store karte hain aur copy by
assignment hoti hai. Reference types (class, array) addresses store karte
hain aur data share hota hai. Value types small data/performance ke liye use
karo; reference types objects ke liye.”
8. Interface vs Abstract Class
“Interface ek contract define karta hai sirf method signatures ke liye, aur
multiple inheritance allow karta hai. Abstract class code share karta hai
(abstract/concrete methods) aur single inheritance hoti hai. Interfaces
unrelated classes ke liye use karo; abstract classes hierarchies ke liye.”
9. What is a Delegate?
“Delegates type-safe method references hote hain, callbacks aur events ke
liye. Ye multicast support karte hain (multiple methods). Generics ke liye
Func/Action/Predicate use hota hai. Example:
Func<int,int,int> add = (x,y) => x+y;”
10. Async vs Await
“async methods ko mark karta hai jo Task return karte hain. await
asynchronously wait karta hai task complete hone tak without blocking
thread. Dono responsive apps banane me help karte hain without freezing
UI/threads.”
Agar chaho, main ye same Roman English answers ka 1-page Word
(.docx) final version bana doon jise aap direct interview me de ya yaad
karke bol sako.
Kya main ye Word file bana doon?
[Link]
[Link]