Sunday, May 1, 2022

.Net Interview Questions

  

 

 

1.       Main components of .NET framework

.NET framework consists of 2 main components. They are:

 

Common Language Runtime- It is an execution engine that runs the code and provides services that make the development process easier.

Framework Class Library- It has pre-defined methods and properties to implement common and complex functions that can be used by .NET applications.

 

2.       What is CTS?

CTS stands for Common Type System. It follows a set of structured rules according to which a data type should be declared and used in the program code. It is used to describe all the data types that are going to be used in the application.

 

We can create our own classes and functions by following the rules in the CTS. It helps in calling the data type declared in one programming language by other programming languages.

 

3.        Explain CLS

Common Language Specification (CLS) helps the application developers to use the components that are inter-language compatible with certain rules that come with CLS. It also helps in reusing the code among all of the .NET-compatible languages.

 

4.        What is JIT?

JIT stands for Just In Time. It is a compiler that converts the intermediate code into the native language during the execution.

5.       What is a delegate in .NET?

Delegate is representative which helps us to call back to the function and do data communication.

A delegate is a .NET object which defines a method signature and it can pass a function as a parameter.

Delegate always points to a method that matches its specific signature. Users can encapsulate the reference of a method in a delegate object.

When we pass the delegate object in a program, it will call the referenced method. To create a custom event in a class, we can make use of delegate

6. get 4th highest array ?

sort array and remove duplicates c#

// 4th highest 123,123,122,12334,1212,1211,321,2334,1211,12334,2123,1221,222,122

public static void Main()

{

Console.WriteLine("Hello World");

getArray();

}

public static void getArray()

{

int[] myArr=new []{123,123,122,12334,1212,1211,321,2334,1211,12334,2123,1221,222,122};

int[] newArr=myArr.Distinct().ToArray();

Array.Sort(newArr);

Console.WriteLine("Sorted array:");

for(int i=0;i<newArr.Length;i++)

Console.WriteLine(newArr[i].ToString());

Array.Reverse(newArr);

Console.WriteLine("4th highest: "+newArr[3].ToString());

}



  • C# reverse of String without changing special characters position
  • polymorphism c# example with program
  • Web Api Security implementation
  • Web Api session management
  • MVC Session management
  • MVC Security

No comments:

Post a Comment