ASP.NET
- Explain the ASP.NET page life cycle.
- Discuss the stages from initialization to rendering, including events like Page_Init, Page_Load, Page_PreRender, and Page_Unload.
- What is the difference between ASP.NET Web Forms and ASP.NET MVC?
- Highlight key differences in architecture, control, flexibility, and usage scenarios. Explain how MVC provides separation of concerns and is more suited for modern web applications.
- How do you handle state management in ASP.NET?
- Discuss techniques like ViewState, Session State, Application State, Cookies, and Query Strings. Explain when to use each method.
- What are HttpHandlers and HttpModules?
- Describe how HttpHandlers are responsible for processing incoming HTTP requests and HttpModules are used to inspect and/or modify the request and response.
- Explain the role of Global.asax in an ASP.NET application.
- Discuss its usage for application-level event handling, such as Application_Start, Session_Start, Application_BeginRequest, and Application_End.
- What is Web API, and how does it differ from WCF?
- Explain the usage of Web API for creating RESTful services and how it differs from WCF in terms of configuration, protocol support, and ease of use.
- How do you implement authentication and authorization in ASP.NET?
- Discuss methods like Forms Authentication, Windows Authentication, and OAuth. Explain the use of attributes like [Authorize] and role-based authorization.
- What are Razor Pages in ASP.NET Core?
- Describe the Razor Pages framework, its benefits over traditional MVC for simple page-focused scenarios, and how it simplifies page programming.
- How do you handle error handling and logging in ASP.NET?
- Discuss the use of try-catch blocks, custom error pages, the Global.asax file, and logging frameworks like NLog, Serilog, or built-in logging in ASP.NET Core.
- What is Dependency Injection, and how is it used in ASP.NET Core?
- Explain the concept of Dependency Injection (DI), its benefits, and how ASP.NET Core implements DI using the built-in service container.
C#
- Explain the difference between value types and reference types in C#.
- Describe how value types are stored on the stack and reference types on the heap. Provide examples of each.
- What is the difference between public, private, protected, and internal access modifiers?
- Explain the scope and visibility of each access modifier within and outside of assemblies and classes.
- What is LINQ, and how is it used in C#?
- Discuss Language Integrated Query (LINQ), its syntax, and how it is used to query collections, databases, XML, etc.
- How do you implement exception handling in C#?
- Describe the use of try-catch blocks, finally statements, and custom exception classes.
- What is the purpose of the async and await keywords in C#?
- Explain asynchronous programming, how async and await simplify writing asynchronous code, and provide a simple example.
- What are delegates and events in C#?
- Describe delegates as type-safe function pointers and how they are used to define events. Provide an example of event subscription and invocation.
- What is the difference between an abstract class and an interface in C#?
- Highlight key differences in usage, inheritance, and implementation. Explain scenarios where each should be used.
- What is garbage collection, and how does it work in .NET?
- Discuss the automatic memory management system in .NET, how garbage collection works, and concepts like generations, finalization, and disposal.
- Explain the SOLID principles in C#.
- Describe each of the SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion) and how they guide object-oriented design.
- What are generics in C#, and why are they useful?
- Explain the concept of generics, how they promote type safety and reusability, and provide examples of generic classes and methods.
SQL Server
- What are the different types of joins in SQL Server?
- Describe INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN, CROSS JOIN, and provide examples of their usage.
- Explain the concept of indexing in SQL Server.
- Discuss clustered and non-clustered indexes, their importance in query performance, and the impact on insert/update/delete operations.
- How do you optimize a SQL query?
- Provide strategies for query optimization, such as indexing, query refactoring, avoiding subqueries, and using execution plans.
- What is the difference between a primary key and a unique key?
- Explain the uniqueness constraint of both, differences in nullability, and their role in database design.
- How do you handle transactions in SQL Server?
- Discuss the concept of transactions, ACID properties, and SQL statements like BEGIN TRANSACTION, COMMIT, and ROLLBACK.
- What are stored procedures and functions in SQL Server?
- Explain the difference between stored procedures and functions, their use cases, and how they improve performance and security.
- What is normalization, and why is it important in database design?
- Describe normalization, the different normal forms (1NF, 2NF, 3NF, etc.), and how normalization reduces redundancy and improves data integrity.
- How do you use the GROUP BY clause in SQL Server?
- Explain the GROUP BY clause, its syntax, and how it is used to aggregate data using functions like SUM, COUNT, AVG, etc.
- What are triggers in SQL Server?
- Discuss the purpose of triggers, types of triggers (DML, DDL, LOGON), and provide examples of their usage in enforcing business rules.
- How do you implement error handling in SQL Server?
- Explain the use of TRY…CATCH blocks, how to handle exceptions, and log errors in SQL Server.