Top C# Interview Questions and Answers for 2023.

In this article, I am going to Explain Top interview question and answers in 2023. In this initial part we are going to discuss the basic C# interview questions and answers and then discuss interview questions and answers for beginners. Lets starts with  following interview questions and answers.

What is COM in C#?

COM is Component Object Model, is a Microsoft technology for creating and using reusable software components in Windows. C# provides and support for developing and using COM components through the System.Runtime.InteropServices namespace, which includes classes for working with COM objects and for converting between common language runtime types and COM types.

Using COM, C# developers can access functionality provided by existing COM components, such as those found in the Windows operating system or in other software applications.

At initial phase COM, VB is the programming language that is used to implement windows applications and ASP is used to implement web applications.


Advantages using COM in C#:

COM objects have a different functionality and are used in many Windows applications and programming, so they can provide many useful features and capabilities to C# programs.


Disadvantages of using COM in C#:

COM objects are typically written in C++ and can be difficult to understand and use for C# developers who are not familiar with C++.

COM objects can be less performant than native C# code.

What is BCL(Base Class Libraries):

Base class libraries developed by Microsoft Technologies. Does not any code without BCL.

BCL contains predefined classes and these classes are used for the purpose of application development. The physical location of BCL is C:\Windows\assembly

What is CLR?

CLR means Common Language Runtime, that is the execution engine of the .NET framework. It provides a platform-independent execution environment for code written in any .NET-compatible language, likes C#, F#, or Visual Basic.

The CLR is responsible for managing the execution of code, including tasks likes memory management, security, and exception handling.

CLR is core component which is run under .NET Framework and it is responsible for converting MSIL code int native code. Lets Consider below example


 public class MainClass{

public static void main(){

int num=10;

Console.writeline(num.toString());

}
} 

 In .NET the code is compiled twice

  • In first time compilation source code  is compiled by the respective language compiler and the language compiler generates intermediate code which is also known as MSIL  Or IL  Or Managed code.
  • In the second compilation, MSIL is converted into Native Code (Machine code) using CLR.











Newest
Previous
Next Post »