{"id":3888,"date":"2024-10-19T12:26:53","date_gmt":"2024-10-19T12:26:53","guid":{"rendered":"https:\/\/www.kaashivinfotech.com\/blog\/?p=3888"},"modified":"2025-07-19T10:26:53","modified_gmt":"2025-07-19T10:26:53","slug":"dotnet-interview-questions-for-fresher-with-answers","status":"publish","type":"post","link":"https:\/\/www.kaashivinfotech.com\/blog\/dotnet-interview-questions-for-fresher-with-answers\/","title":{"rendered":".Net Interview Questions for fresher with Answers"},"content":{"rendered":"<h2 class=\"serp-title\">.Net Interview Questions for fresher with Answers<\/h2>\n<p style=\"text-align: justify;\">.Net Interview Questions for fresher with Answers -.NET is a software development framework created by Microsoft, used to build a wide range of applications, from web to desktop and mobile. For freshers, .NET interview questions typically focus on the basics of the .NET framework, its architecture, and core components such as the Common Language Runtime (CLR) and the .NET class library. You may be asked about your understanding of programming languages like C# or VB.NET, and how .NET supports multiple languages through the CLR.<\/p>\n<p style=\"text-align: justify;\">.Net Interview Questions Common topics include <a href=\"https:\/\/www.kaashivinfotech.com\/blog\/top-features-of-oops\/\">object-oriented programming (OOP) concepts<\/a> like inheritance, polymorphism, encapsulation, and abstraction. You may also encounter .Net Interview Questions\u00a0 questions on the differences between .NET Framework and .NET Core, handling exceptions, using collections, and working with databases via ADO.NET or Entity Framework. Understanding the basics of ASP.NET for web development, along with front-end technologies like HTML, CSS, and JavaScript, can also be useful. Additionally, knowledge of Visual Studio as an integrated development environment (IDE) is often expected.<\/p>\n<p style=\"text-align: justify;\">Here the most important\u00a0<a href=\"https:\/\/www.kaashivinfotech.com\/blog\/dotnet-programming-interview-questions-and-answers\/\"> .Net Interview Questions<\/a> for fresher with Answers .<\/p>\n<h2><strong>1.What is .NET Framework?<\/strong><\/h2>\n<p style=\"text-align: justify;\">The <strong>.NET Framework<\/strong> is a software development platform developed by <strong>Microsoft<\/strong>. It provides a large library of pre-built <strong>class libraries<\/strong> and supports multiple programming languages like <strong>C#<\/strong>, <strong>VB.NET<\/strong>, and <strong>F#<\/strong>. The framework simplifies the development of applications by providing a <strong>runtime environment<\/strong>, known as the <strong>Common Language Runtime (CLR)<\/strong>, and a comprehensive set of libraries for tasks like <strong>file handling<\/strong>, <strong>database access<\/strong>, and <strong>web development<\/strong>.<\/p>\n<h2><strong>2.What is the CLR in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\">The <strong>Common Language Runtime (CLR)<\/strong> is the virtual machine component of the .NET Framework. It provides services like <strong>memory management<\/strong>, <strong>garbage collection<\/strong>, <strong>exception handling<\/strong>, and <strong>type safety<\/strong>. The CLR allows code written in different .NET languages to be executed on any system that has the .NET Framework installed, making the application platform-independent.<\/p>\n<h2><strong>3.What is C#?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>C#<\/strong> (pronounced as <strong>C-Sharp<\/strong>) is a modern, object-oriented programming language developed by Microsoft within the .NET ecosystem. It is used to build a variety of applications, including <strong>web applications<\/strong>, <strong>desktop applications<\/strong>, <strong>mobile apps<\/strong>, and <strong>games<\/strong>. It combines the power of <strong>C++<\/strong> with the simplicity of <a href=\"https:\/\/www.kaashivinfotech.com\/blog\/java-interview-questions-for-fresher-with-answers\/\"><strong>Java<\/strong><\/a>, making it one of the most widely used languages for <strong>enterprise-level<\/strong> applications.<\/p>\n<h2><strong>4.What is ASP.NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>ASP.NET<\/strong> is a <strong>web development<\/strong> framework in the .NET platform that allows developers to create dynamic web pages, applications, and services. It supports multiple development models, including <strong>MVC (Model-View-Controller)<\/strong> and <strong>Web Forms<\/strong>. ASP.NET simplifies tasks like <strong>form handling<\/strong>, <strong>session management<\/strong>, and <strong>authentication<\/strong>, providing a robust solution for <strong>web-based applications<\/strong>.<\/p>\n<h2><strong>5.What is ASP.NET MVC?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>ASP.NET MVC<\/strong> is a framework used for building web applications using the <strong>Model-View-Controller<\/strong> design pattern. In this architecture, the <strong>Model<\/strong> represents the data, the <strong>View<\/strong> displays the data, and the <strong>Controller<\/strong> manages user interaction. ASP.NET MVC promotes <strong>separation of concerns<\/strong> and makes web applications more <strong>modular<\/strong>, easier to maintain, and testable.<\/p>\n<h2><strong>6.What is .NET Core?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>.NET Core<\/strong> is an open-source, cross-platform version of the .NET Framework, allowing developers to build applications that run on <strong>Windows<\/strong>, <strong>Linux<\/strong>, and <strong>macOS<\/strong>. It is optimized for <strong>performance<\/strong> and <strong>scalability<\/strong>, making it suitable for <strong>microservices<\/strong>, <strong>cloud-based applications<\/strong>, and <strong>enterprise applications<\/strong>. .NET Core is the future of the .NET platform and has evolved into <strong>.NET 5<\/strong> and beyond.<\/p>\n<h2><strong>7.What is the difference between .NET Framework and .NET Core?<\/strong><\/h2>\n<p style=\"text-align: justify;\">The main difference between <strong>.NET Framework<\/strong> and <strong>.NET Core<\/strong> is that the .NET Framework is designed for Windows-only applications, while <strong>.NET Core<\/strong> is <strong>cross-platform<\/strong> and runs on Windows, Linux, and macOS. .NET Core is also <strong>lightweight<\/strong>, <strong>modular<\/strong>, and more suited for <strong>cloud<\/strong> and <strong>microservices architectures<\/strong>.<\/p>\n<h2><strong>8.What are Assemblies in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\">An <strong>Assembly<\/strong> is a compiled code library in .NET that contains one or more <strong>namespaces<\/strong> and <strong>classes<\/strong>. Assemblies are the building blocks of a .NET application, providing a way to manage code deployment, versioning, and security. They come in two types: <strong>DLL (Dynamic Link Library)<\/strong> for shared code, and <strong>EXE<\/strong> for executables.<\/p>\n<h2><strong>9.What is the GAC (Global Assembly Cache)?<\/strong><\/h2>\n<p style=\"text-align: justify;\">The <strong>Global Assembly Cache (GAC)<\/strong> is a special folder in the .NET Framework where <strong>shared assemblies<\/strong> are stored. Assemblies that are intended to be used by multiple applications on a machine are installed in the GAC. The GAC helps in <strong>versioning<\/strong> and ensures that applications can reference the correct version of an assembly.<\/p>\n<h2><strong>10.What is Managed Code in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Managed code<\/strong> is code that runs under the control of the <strong>Common Language Runtime (CLR)<\/strong> in the .NET environment. The CLR provides services like <strong>memory management<\/strong>, <strong>security<\/strong>, and <strong>exception handling<\/strong>, making managed code more secure and easier to debug. In contrast, <strong>unmanaged code<\/strong> is executed directly by the operating system.<\/p>\n<h2><strong>11.What are the advantages of using .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\">Some key <strong>advantages<\/strong> of using .NET include:<\/p>\n<ul style=\"text-align: justify;\">\n<li><strong>Cross-platform development<\/strong> (with .NET Core).<\/li>\n<li><strong>Support for multiple programming languages<\/strong>.<\/li>\n<li><strong>Rich class library<\/strong> and built-in functionalities.<\/li>\n<li><strong>Robust memory management<\/strong> through <strong>garbage collection<\/strong>.<\/li>\n<li><strong>Improved security<\/strong> features.<\/li>\n<li><strong>Support for modern development paradigms<\/strong> like <strong>REST APIs<\/strong>, <strong>Microservices<\/strong>, and <strong>Cloud<\/strong>.<\/li>\n<\/ul>\n<h2><strong>12.What is Garbage Collection in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Garbage Collection (GC)<\/strong> is an automatic memory management feature of the CLR that reclaims memory occupied by <strong>unused objects<\/strong>. The GC operates in the background and runs when the system is low on memory. It helps prevent <strong>memory leaks<\/strong> and optimizes the application&#8217;s memory usage.<\/p>\n<h2><strong>13.What are Value Types and Reference Types in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\">In .NET, <strong>Value Types<\/strong> store data directly in memory, and their values are stored in the <strong>stack<\/strong> (e.g., <strong>int<\/strong>, <strong>float<\/strong>, <strong>bool<\/strong>). <strong>Reference Types<\/strong> store a reference to the actual data, and their values are stored in the <strong>heap<\/strong> (e.g., <strong>class<\/strong>, <strong>object<\/strong>, <strong>string<\/strong>). Understanding this distinction helps in managing <strong>memory usage<\/strong> efficiently.<\/p>\n<h2><strong>14.What is the difference between Stack and Heap?<\/strong><\/h2>\n<p style=\"text-align: justify;\">The <strong>Stack<\/strong> is a region of memory used for <strong>static memory allocation<\/strong>. It stores value types and reference pointers. The <strong>Heap<\/strong> is used for <strong>dynamic memory allocation<\/strong>, and it stores objects created with <strong>new<\/strong>. The Stack has faster access times but limited size, while the Heap can store more data but is slower.<\/p>\n<h2><strong>15.What is LINQ?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>LINQ (Language Integrated Query)<\/strong> is a feature in .NET that allows developers to write <strong>queries<\/strong> directly in C# or VB.NET to retrieve data from various sources like <strong>collections<\/strong>, <strong>databases<\/strong>, or <strong>XML<\/strong>. LINQ provides a <strong>uniform<\/strong> way to interact with different data sources, reducing code complexity and increasing readability.<\/p>\n<h2><strong>16.What is the Entity Framework (EF)?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Entity Framework (EF)<\/strong> is an <strong>Object-Relational Mapping (ORM)<\/strong> tool in .NET that simplifies database operations. EF allows developers to work with databases using <strong>.NET objects<\/strong> (entities) instead of writing SQL queries. It supports <strong>LINQ to Entities<\/strong> for querying data and provides features like <strong>code-first<\/strong> and <strong>database-first<\/strong> approaches.<\/p>\n<h2><strong>17.What is Dependency Injection in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Dependency Injection (DI)<\/strong> is a design pattern used in .NET to achieve <strong>loose coupling<\/strong> between classes. Instead of creating objects within a class, the objects are <strong>injected<\/strong> into the class through <strong>constructors<\/strong>, <strong>methods<\/strong>, or <strong>properties<\/strong>. DI is widely used in frameworks like <strong>ASP.NET Core<\/strong> to manage <strong>services<\/strong> and <strong>dependencies<\/strong>.<\/p>\n<h2><strong>18.What are the different types of JIT (Just-in-Time) compilation in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\">The .NET Framework uses <strong>Just-in-Time (JIT)<\/strong> compilation to convert <strong>MSIL (Microsoft Intermediate Language)<\/strong> into <strong>native code<\/strong>. There are three types of JIT:<\/p>\n<ul style=\"text-align: justify;\">\n<li><strong>Normal JIT<\/strong>: Compiles code when it&#8217;s called for the first time.<\/li>\n<li><strong>Econo JIT<\/strong>: Compiles code in a way that reduces memory usage.<\/li>\n<li><strong>Pre-JIT<\/strong>: Compiles the entire code before execution (used in <strong>NGEN<\/strong>).<\/li>\n<\/ul>\n<h2><strong>19.What is ASP.NET Web API?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>ASP.NET Web API<\/strong> is a framework that allows developers to build <strong>RESTful services<\/strong> over HTTP. It is used to create services that can be consumed by <strong>web applications<\/strong>, <strong>mobile apps<\/strong>, and <strong>IoT devices<\/strong>. Web API supports <strong>JSON<\/strong> and <strong>XML<\/strong> as the data formats and is ideal for <strong>stateless<\/strong> applications.<\/p>\n<h2><strong>20.What are Middleware components in ASP.NET Core?<\/strong><\/h2>\n<p style=\"text-align: justify;\">In <strong>ASP.NET Core<\/strong>, <strong>middleware<\/strong> are components that are assembled into an <strong>HTTP request pipeline<\/strong> to handle requests and responses. Each middleware can either <strong>process<\/strong> the incoming request or pass it on to the next middleware. Common middleware includes <strong>Authentication<\/strong>, <strong>Routing<\/strong>, <strong>Exception Handling<\/strong>, and <strong>Static Files<\/strong>.<\/p>\n<h2><strong>21.What is a ViewModel in ASP.NET MVC?<\/strong><\/h2>\n<p style=\"text-align: justify;\">A <strong>ViewModel<\/strong> in <strong>ASP.NET MVC<\/strong> is a class that represents the data needed for rendering a <strong>View<\/strong>. It acts as a bridge between the <strong>Model<\/strong> and the <strong>View<\/strong>, containing properties that the view will bind to. The use of ViewModels helps maintain a <strong>clean separation<\/strong> between the data layer and the presentation layer.<\/p>\n<h2><strong>22.What is Razor in ASP.NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Razor<\/strong> is a <strong>view engine<\/strong> in ASP.NET MVC that allows developers to write <strong>server-side code<\/strong> (C# or VB.NET) in <strong>HTML pages<\/strong>. Razor syntax is clean and lightweight, offering an easy way to integrate dynamic content into web pages. Razor views end with <strong>.cshtml<\/strong> (for C#) or <strong>.vbhtml<\/strong> (for VB.NET).<\/p>\n<h2><strong>23.What is .NET Standard?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>.NET Standard<\/strong> is a formal specification of APIs that all .NET implementations must provide. It ensures that different versions of .NET, such as <strong>.NET Framework<\/strong>, <strong>.NET Core<\/strong>, and <strong>Xamarin<\/strong>, can use the same set of libraries. This enhances code <strong>reusability<\/strong> and helps developers build applications across different platforms.<\/p>\n<h2><strong>24.What is the role of NuGet in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>NuGet<\/strong> is a <strong>package manager<\/strong> for .NET, which provides a way to share and consume code libraries across projects. Developers can easily install, update, and manage dependencies by using <strong>NuGet packages<\/strong>, which are stored in repositories like <strong>nuget.org<\/strong>. NuGet simplifies code sharing and helps in managing library versions.<\/p>\n<h2><strong>25.What is Kestrel in ASP.NET Core?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Kestrel<\/strong> is a cross-platform <strong>web server<\/strong> included with ASP.NET Core. It is lightweight and highly efficient, making it suitable for both <strong>development<\/strong> and <strong>production<\/strong> environments. While Kestrel can handle most scenarios, it is often used with reverse proxies like <strong>IIS<\/strong> or <strong>NGINX<\/strong> for additional features like <strong>security<\/strong> and <strong>load balancing<\/strong>.<\/p>\n<h2><strong>26.What is the difference between Task and Thread in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\">In <strong>.NET<\/strong>, a <strong>Thread<\/strong> is a unit of execution that runs in parallel, directly managed by the operating system. A <strong>Task<\/strong> is a higher-level abstraction built on top of <strong>Threads<\/strong> that simplifies asynchronous programming and is managed by the <strong>Task Parallel Library (TPL)<\/strong>. While both represent parallel work, <strong>Tasks<\/strong> offer more flexibility and features, such as <strong>continuations<\/strong>, <strong>cancellation<\/strong>, and better error handling.<\/p>\n<h2><strong>27.What is asynchronous programming in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Asynchronous programming<\/strong> in .NET allows for non-blocking code execution, enabling programs to perform other tasks while waiting for long-running operations (like I\/O operations) to complete. This is achieved using the async and await keywords, which simplify the writing of <strong>asynchronous methods<\/strong> and improve performance in <strong>web applications<\/strong> or <strong>services<\/strong> where responsiveness is critical.<\/p>\n<h2><strong>28.What is the difference between Abstract Class and Interface in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\">An <strong>Abstract Class<\/strong> can have both <strong>abstract<\/strong> (without implementation) and <strong>concrete methods<\/strong> (with implementation), while an <strong>Interface<\/strong> can only declare <strong>methods<\/strong> or <strong>properties<\/strong> without providing any implementation. Abstract classes are used for <strong>inheritance hierarchies<\/strong>, while interfaces define <strong>contracts<\/strong> that classes must implement. A class can inherit from one abstract class but implement multiple interfaces.<\/p>\n<h2><strong>29.What is the .NET MAUI?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>.NET MAUI (Multi-platform App UI)<\/strong> is a cross-platform framework that allows developers to build applications for <strong>iOS<\/strong>, <strong>Android<\/strong>, <strong>Windows<\/strong>, and <strong>macOS<\/strong> using a single codebase. It is the evolution of <strong>Xamarin.Forms<\/strong> and part of .NET 6+. It enables the development of rich <strong>UI<\/strong> applications, providing a unified <strong>UI toolkit<\/strong> and a simplified approach for cross-platform development.<\/p>\n<h2><strong>30.What are Generics in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Generics<\/strong> in .NET allow developers to define classes, methods, and interfaces with <strong>type parameters<\/strong>, which means that the same code can work with any data type. Generics improve <strong>type safety<\/strong>, <strong>reusability<\/strong>, and <strong>performance<\/strong> by eliminating the need for <strong>boxing<\/strong> and <strong>unboxing<\/strong>. They are commonly used in collections (e.g., <strong>List&lt;T&gt;<\/strong>) and other data structures.<\/p>\n<h2><strong>31.What is the role of IL (Intermediate Language) in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Intermediate Language (IL)<\/strong> is the low-level, <strong>platform-independent<\/strong> instruction set used by .NET languages (e.g., C# or VB.NET) after compilation. Code written in .NET languages is first compiled into <strong>IL<\/strong> and then converted into <strong>machine code<\/strong> by the <strong>JIT (Just-In-Time) compiler<\/strong> during runtime. IL enables cross-language interoperability within the .NET environment.<\/p>\n<h2><strong>32.What is the difference between Overriding and Overloading in C#?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Overriding<\/strong> refers to modifying the implementation of a <strong>method<\/strong> in a derived class that was originally defined in a base class using the override keyword. <strong>Overloading<\/strong> occurs when multiple methods in the same class have the <strong>same name<\/strong> but different <strong>parameters<\/strong> (e.g., method signatures). Overriding is related to <strong>polymorphism<\/strong>, while overloading improves <strong>code readability<\/strong>.<\/p>\n<h2><strong>33.What is a Singleton Pattern in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\">The <strong>Singleton Pattern<\/strong> ensures that a class has only one instance throughout the application&#8217;s lifecycle and provides a global point of access to that instance. This pattern is useful for classes that handle <strong>logging<\/strong>, <strong>configuration settings<\/strong>, or <strong>database connections<\/strong>. In .NET, it can be implemented by creating a <strong>static property<\/strong> or method that returns the single instance.<\/p>\n<h2><strong>34.What is the use of IDisposable Interface in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\">The <strong>IDisposable<\/strong> interface defines a <strong>Dispose<\/strong> method that developers can implement to release <strong>unmanaged resources<\/strong> like file handles, database connections, or network connections. Objects that implement <strong>IDisposable<\/strong> should have their Dispose() method called when they are no longer needed. In C#, this can be managed automatically using the using statement.<\/p>\n<h2><strong>35.What is Reflection in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Reflection<\/strong> in .NET allows a program to examine its own structure or modify its behavior at runtime. It is used to <strong>inspect assemblies<\/strong>, <strong>classes<\/strong>, <strong>methods<\/strong>, and <strong>properties<\/strong> dynamically. Reflection is commonly used in <strong>serialization<\/strong>, <strong>dependency injection<\/strong>, and building tools like <strong>ORMs<\/strong> or <strong>test frameworks<\/strong>.<\/p>\n<h2><strong>36.What is a Delegate in C#?<\/strong><\/h2>\n<p style=\"text-align: justify;\">A <strong>Delegate<\/strong> in C# is a <strong>type-safe function pointer<\/strong> that holds references to methods. It allows methods to be passed as parameters, enabling <strong>callback<\/strong> functionality or <strong>event handling<\/strong>. Delegates are the foundation of <strong>anonymous methods<\/strong>, <strong>lambda expressions<\/strong>, and <strong>events<\/strong> in C#. They promote <strong>loosely coupled<\/strong> code by decoupling method invocation from implementation.<\/p>\n<h2><strong>37.What is an Event in C#?<\/strong><\/h2>\n<p style=\"text-align: justify;\">An <strong>Event<\/strong> in C# is a messaging system that allows objects to <strong>notify<\/strong> other objects (subscribers) about changes or actions. Events are built on top of <strong>delegates<\/strong> and follow a <strong>publish-subscribe<\/strong> model. When an event is raised, all subscribed methods are executed. Events are commonly used for <strong>UI actions<\/strong>, like button clicks.<\/p>\n<h2><strong>38.What is ADO.NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>ADO.NET<\/strong> is a set of <strong>classes<\/strong> in .NET used for interacting with databases. It allows developers to connect to databases, execute <strong>SQL commands<\/strong>, and retrieve <strong>data<\/strong> using objects like <strong>Connection<\/strong>, <strong>Command<\/strong>, <strong>DataReader<\/strong>, and <strong>DataSet<\/strong>. ADO.NET supports both <strong>connected<\/strong> and <strong>disconnected<\/strong> data architectures and is widely used for data access in .NET applications.<\/p>\n<h2><strong>39.What is MVC in ASP.NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>MVC (Model-View-Controller)<\/strong> is an <strong>architectural pattern<\/strong> used in ASP.NET to create <strong>web applications<\/strong>. It divides the application into three components:<\/p>\n<ul style=\"text-align: justify;\">\n<li><strong>Model<\/strong>: Represents the data.<\/li>\n<li><strong>View<\/strong>: Renders the UI.<\/li>\n<li><strong>Controller<\/strong>: Handles user input and updates the model and view accordingly. This separation enhances <strong>modularity<\/strong>, <strong>testability<\/strong>, and <strong>maintainability<\/strong>.<\/li>\n<\/ul>\n<h2><strong>40.What is OAuth in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>OAuth<\/strong> is an open-standard <strong>authorization protocol<\/strong> that allows users to grant third-party applications limited access to their resources without sharing their credentials. In .NET, <strong>OAuth<\/strong> is used to secure APIs and enable <strong>single sign-on<\/strong> (SSO) by integrating with services like <a href=\"https:\/\/www.kaashivinfotech.com\/blog\/intermediate-google-cloud-platform-interview-questions-answers\/\"><strong>Google<\/strong><\/a>, <strong>Facebook<\/strong>, or <strong>Microsoft<\/strong> for authentication.<\/p>\n<h2><strong>41.What is SignalR in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>SignalR<\/strong> is a library in .NET that enables <strong>real-time web functionality<\/strong>. It allows the server to push <strong>asynchronous updates<\/strong> to the client over WebSockets, Long Polling, or Server-Sent Events. SignalR is commonly used for building applications like <strong>chat applications<\/strong>, <strong>live dashboards<\/strong>, and <strong>real-time notifications<\/strong>.<\/p>\n<h2><strong>42.What are Web Services in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Web Services<\/strong> in <a href=\"https:\/\/dotnet.microsoft.com\/en-us\/learn\/dotnet\/what-is-dotnet\" target=\"_blank\" rel=\"noopener\">.NET<\/a> are standardized ways for applications to communicate with each other over the internet using protocols like <strong>SOAP<\/strong> or <strong>REST<\/strong>. They enable <strong>interoperability<\/strong> between applications running on different platforms. In .NET, <strong>WCF (Windows Communication Foundation)<\/strong> and <strong>ASP.NET Web API<\/strong> are used to create and consume web services.<\/p>\n<h2><strong>43.What is Microservices Architecture in .NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\">A <strong>Microservices Architecture<\/strong> is a design pattern where a large application is divided into small, loosely coupled services, each performing a specific function. In .NET, <strong>ASP.NET Core<\/strong> is often used to build <strong>microservices<\/strong>. Each microservice can be independently developed, deployed, and scaled, making the architecture ideal for <strong>cloud-based applications<\/strong>.<\/p>\n<h2><strong>44.What is JWT (JSON Web Token)?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>JWT (JSON Web Token)<\/strong> is a compact, self-contained way of securely transmitting information between parties as a <strong>JSON<\/strong> object. It is commonly used for <strong>authentication<\/strong> and <strong>authorization<\/strong> in <strong>ASP.NET Core<\/strong> applications. A JWT contains a <strong>header<\/strong>, <strong>payload<\/strong>, and <strong>signature<\/strong> and is used in token-based security mechanisms for APIs and microservices.<\/p>\n<h2><strong>45.What is the role of the Global.asax file in ASP.NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\">The <strong>Global.asax<\/strong> file in ASP.NET is used to define application-level events like <strong>Application_Start<\/strong>, <strong>Application_End<\/strong>, <strong>Session_Start<\/strong>, and <strong>Session_End<\/strong>. These events are triggered by the ASP.NET runtime during the lifecycle of the application. It allows developers to perform initialization tasks, such as <strong>caching<\/strong>, <strong>logging<\/strong>, and <strong>error handling<\/strong>.<\/p>\n<h2><strong>46.What is ViewState in ASP.NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>ViewState<\/strong> is a mechanism in <strong>ASP.NET Web Forms<\/strong> to persist the state of a page&#8217;s controls across postbacks. It stores data in a hidden <strong>input field<\/strong> on the page as a <strong>Base64-encoded<\/strong> string, ensuring that control properties retain their values when the page is reloaded. While ViewState simplifies state management, it can increase <strong>page size<\/strong>.<\/p>\n<h2><strong>47.What is Web.config in ASP.NET?<\/strong><\/h2>\n<p style=\"text-align: justify;\">The <strong>Web.config<\/strong> file is an <strong>XML-based configuration file<\/strong> used in ASP.NET applications to configure settings like <strong>authentication<\/strong>, <strong>authorization<\/strong>, <strong>session state<\/strong>, <strong>custom error pages<\/strong>, and <strong>connection strings<\/strong>. Changes to the Web.config file are automatically detected by the application, so there&#8217;s no need to restart the application for updates to take effect.<\/p>\n<h2><strong>48.What is the difference between WPF and Windows Forms?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>WPF (Windows Presentation Foundation)<\/strong> is a modern UI framework for building <strong>desktop applications<\/strong> with advanced <strong>graphics<\/strong> and <strong>data-binding<\/strong> capabilities. It supports a more flexible layout system and is better for high-performance apps. <strong>Windows Forms<\/strong>, on the other hand, is an older UI framework focused on simplicity and ease of use but lacks advanced UI features like WPF.<\/p>\n<h2><strong>49.What is the role of Filters in ASP.NET MVC?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>Filters<\/strong> in ASP.NET MVC are used to perform <strong>cross-cutting concerns<\/strong> like <strong>authorization<\/strong>, <strong>logging<\/strong>, <strong>exception handling<\/strong>, and <strong>caching<\/strong>. There are different types of filters, including <strong>Authorization Filters<\/strong>, <strong>Action Filters<\/strong>, <strong>Result Filters<\/strong>, and <strong>Exception Filters<\/strong>. Filters are executed at various stages of the request pipeline and can be applied globally or to specific actions.<\/p>\n<h2><strong>50.What is the difference between REST and SOAP Web Services?<\/strong><\/h2>\n<p style=\"text-align: justify;\"><strong>REST (Representational State Transfer)<\/strong> is a lightweight, stateless architecture for building <strong>web services<\/strong> that use standard <strong>HTTP methods<\/strong> (GET, POST, PUT, DELETE). <strong>SOAP (Simple Object Access Protocol)<\/strong> is a more rigid protocol that uses XML and requires predefined messaging patterns. REST is preferred for <strong>scalability<\/strong>, while SOAP is more suitable for <strong>enterprise-level<\/strong> security and <strong>transactional systems<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>.Net Interview Questions for fresher with Answers .Net Interview Questions for fresher with Answers -.NET is a software development framework created by Microsoft, used to build a wide range of applications, from web to desktop and mobile. For freshers, .NET interview questions typically focus on the basics of the .NET framework, its architecture, and core [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":3922,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[724],"tags":[804,806,2618,2617,800,801,803,1033,2620,811,2619,1031],"class_list":["post-3888","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interview-questions","tag-net-interview-questions","tag-net-interview-questions-and-answers","tag-net-interview-questions-with-answers","tag-net-interview-questions-with-answers-for-freshers","tag-asp-net-interview-questions-and-answers","tag-c-interview-questions","tag-c-interview-questions-and-answers","tag-c-interview-questions-and-answers-for-experienced","tag-c-interview-questions-for-experienced-professionals","tag-c-interview-questions-with-answers","tag-c-interview-questions-with-answers-pdf","tag-interview-questions-and-answers"],"_links":{"self":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/3888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/comments?post=3888"}],"version-history":[{"count":0,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/3888\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/media\/3922"}],"wp:attachment":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/media?parent=3888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/categories?post=3888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/tags?post=3888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}