Top 20 .NET, ASP.NET MVC, SQL Server & Angular Interview Questions with Answers (2025 Guide)

Whether you're preparing for your next interview or brushing up on full-stack development concepts, these frequently asked questions across .NET, ASP.NET MVC, SQL Server, and Angular will help you stand out with clarity and confidence.
✅ .NET / .NET Core
1. What is the difference between .NET Framework and .NET Core?
.NET Framework is Windows-only, while .NET Core is cross-platform (Windows, Linux, macOS). .NET Core also provides better performance, modular architecture, and support for microservices and cloud-native development. With the introduction of .NET 5+, the ecosystem is unified under .NET (dropping "Core").
2. What is Dependency Injection in .NET Core?
Dependency Injection (DI) is a design pattern used to achieve Inversion of Control (IoC) between classes and their dependencies. It’s built-in in .NET Core.
services.AddScoped<IMyService, MyService>();
3. Explain Middleware in ASP.NET Core.
Middleware is software in the request/response pipeline. Each middleware can process the request or pass it to the next.
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(...);
4. Difference: AddScoped vs AddSingleton vs AddTransient
Method | Lifetime |
AddSingleton | One instance for the entire app |
AddScoped | One instance per HTTP request |
AddTransient | New instance each time requested |
5. Role of Program.cs & Startup.cs in .NET 6/7
In .NET 6+, Startup.cs is merged into Program.cs using the Minimal Hosting Model.
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
6. How do you handle configuration & logging in .NET Core?
Use appsettings.json
, IConfiguration
, and ILogger
for config and logging.
builder.Logging.AddConsole();
var configValue = configuration["MySettings:Key"];
✅ ASP.NET MVC
7. Explain MVC architecture with a real-time example.
MVC separates app into:
Model: Business logic (e.g.,
Employee.cs
)View: UI (e.g.,
Employee.cshtml
)Controller: Connects model and view (e.g.,
EmployeeController.cs
)
📌 Example: In an Employee Management System, /Employee/Index
fetches data from DB and renders it via the View.
8. Difference between TempData, ViewData, and ViewBag
Feature | ViewData | ViewBag | TempData |
Type | Dictionary | Dynamic | Dictionary |
Scope | Current Request | Current Request | Across Redirects |
Use Case | Pass to View | Simpler syntax | Persist across requests |
9. Types of Filters in MVC
Authorization Filter
Action Filter
Result Filter
Exception Filter
[Authorize]
[HandleError]
10. How does routing work? Explain attribute routing.
Routing uses {controller}/{action}/{id?}
pattern or attribute-based routing.
[Route("products/{id}")]
public IActionResult Details(int id) { ... }
✅ SQL Server
11. SQL query to find second highest salary
SELECT MAX(Salary)
FROM Employees
WHERE Salary < (SELECT MAX(Salary) FROM Employees);
12. Difference: Clustered vs Non-Clustered Index
Feature | Clustered Index | Non-Clustered Index |
Sorting | Yes | No |
Data Storage | Actual rows sorted | Pointers to rows |
Count Per Table | One | Many |
13. What is CTE (Common Table Expression)?
A temporary named result set used for modular queries or recursion.
WITH EmployeeCTE AS (
SELECT Name, Salary FROM Employees WHERE Department = 'IT'
)
SELECT * FROM EmployeeCTE WHERE Salary > 50000;
14. How to delete duplicate records but keep one
WITH CTE AS (
SELECT *, ROW_NUMBER() OVER(PARTITION BY Name, Email ORDER BY Id) AS rn
FROM Users
)
DELETE FROM CTE WHERE rn > 1;
15. Difference: DELETE vs TRUNCATE vs DROP
Operation | DELETE | TRUNCATE | DROP |
Removes Rows | ✅ | ✅ | ❌ |
Rollback | ✅ | ❌ | ❌ |
Uses WHERE | ✅ | ❌ | ❌ |
Resets ID | ❌ | ✅ | ✅ |
✅ Angular
16. Difference between Observable and Promise
Feature | Observable | Promise |
Multiple Values | ✅ | ❌ |
Cancelable | ✅ | ❌ |
Lazy Execution | ✅ | ✅ |
Operators | ✅ (RxJS) | ❌ |
17. Template-driven vs Reactive Forms
Template-driven: Simpler, uses
ngModel
, ideal for small formsReactive: Uses
FormControl
, powerful for dynamic & complex forms
18. What is an HTTP Interceptor?
Used to intercept HTTP requests and modify them (e.g., add headers).
intercept(req: HttpRequest<any>, next: HttpHandler) {
const authReq = req.clone({
headers: req.headers.set('Authorization', 'Bearer token')
});
return next.handle(authReq);
}
19. What is Change Detection?
It checks for changes in component data and updates the DOM. Angular uses zone.js
to detect async events like clicks or HTTP calls.
- Use
ChangeDetectionStrategy.OnPush
for performance boost.
20. How to call and bind REST API data in Angular
this.http.get<Employee[]>('api/employees').subscribe(data => {
this.employees = data;
});
Bind to HTML:
<div *ngFor="let emp of employees">{{ emp.name }}</div>
These 20 questions will help you crack interviews, strengthen your understanding, and prepare solid content for blogging or technical discussions. If you're a full-stack developer working with .NET, Angular, and SQL—this is your 2025-ready cheat sheet!
Save this article
Share it with your friends preparing for SQL interviews
👉 Bookmark this blog for quick revision before your next interview!
👉 Found this helpful? Follow DevDaily for more developer blogs every week!
✍ Written by Rishabh Mishra
Subscribe to my newsletter
Read articles from Rishabh Mishra directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Rishabh Mishra
Rishabh Mishra
Hey, I’m Rishabh — a developer who writes code like poetry and breaks things just to rebuild them better. .NET Full Stack Dev | Razor, C#, MVC, SQL, Angular — my daily playground. I believe in “learning out loud” — so I write about dev struggles, breakthroughs, and the weird bugs that teach the best lessons. From building ERP apps to tinkering with UI/UX — I turn business logic into beautiful experiences. Self-growth > Comfort zone | Debugging is my meditation Let’s turn curiosity into code — one blog at a time.