Special Offer - Enroll Now and Get 2 Course at ₹25000/- Only Explore Now!

All Courses
Dot Net Interview Questions and Answers

Dot Net Interview Questions and Answers

December 6th, 2018

Dot Net Interview Questions and Answers

In case you’re searching for Dot Net Interview Questions and answers for Experienced or Freshers, you are at the correct place. .Net Interview Questions & Answers prepared by our experts help to crack the interviews and obtain the dream role as Dot Net Analyst. This is not restricted to any person as the posted questions are prepared for both beginners and experienced candidates. The entire list comprised of different segments, examples, sample data, and images that are very helpful to get into the topmost MNC companies. For various purposes like online tests, interviews, certification, and corporate exams, you can be benefited from the top 100 plus questions posted here along with its solutions. Topics covered are .Net Framework, important components, CTS, CLR, JIT, MSIL, Caching, MVC, CAS, Globalization & Localization, and many more. You can effortlessly excel in the roles like .Net Developer, Software Developer, and Product Developer.

There is a parcel of chances from many presumed organizations on the planet. The Dot Net advertise is relied upon to develop to more than $5 billion by 2021, from just $180 million, as per Dot Net industry gauges. In this way, despite everything you have the chance to push forward in your vocation in Dot Net Development. Gangboard offers Advanced Dot Net  Interview Questions and answers that assist you in splitting your Dot Net interview and procure dream vocation as Dot Net Developer.

Best Dot Net Interview Questions and Answers

Do you believe that you have the right stuff to be a section in the advancement of future Dot Net, the GangBoard is here to control you to sustain your vocation. Various fortune 1000 organizations around the world are utilizing the innovation of Dot Net to meet the necessities of their customers. Dot Net is being utilized as a part of numerous businesses. To have a great development in Dot Net work, our page furnishes you with nitty-gritty data as Dot Net prospective employee meeting questions and answers. Dot Net  Interview Questions and answers are prepared by 10+ years experienced industry experts. Dot Net Interview Questions and answers are very useful to the Fresher or Experienced person who is looking for the new challenging job from the reputed company. Our Dot Net Questions and answers are very simple and have more examples for your better understanding.

By this Dot Net Interview Questions and answers, many students are got placed in many reputed companies with high package salary. So utilize our Dot Net Interview Questions and answers to grow in your career.

Q1)What is Inheritance?

Derived class inherits the member of  base class is called inheritance. Its one object have all the properties and behaviors of its parent object. Using inheritance we can reuse the code.  We can achive single level and multi level inheritance.

public class Employee
{
public float salary = 400;
}
public class Programmer: Employee
{
public float bonus = 100;
}
class TestInheritance{
public static void Main(string[] args)
{
Programmer p1 = new Programmer();
Console.WriteLine("Salary: " + p1.salary);
Console.WriteLine("Bonus: " + p1.bonus);
}
}

Q2)What is the Generic and non generic collections?

Two types of collections is there one is generic collection another one is non generic collection.
Generic Collection:
We can group one type of object in single collection is called generic collection. Here we dont need to convert particular type like string, int, etc.
Non Generic Collection:
We can group any type of object in single collection is called non generic collection. Here we need to convert particular type like string, int,etc., otherwise we will face issue in run time.

Q3)What are the non generic collections?

  • Array List
  • Sorted List
  • Stack
  • Queue
  • Hashtable
  • Bit Array

Q4) What is a Constructor?

It’s a method which have same name as class or struct name.  It’s called automatically at the time of object creation.

Q5) What are the types of constructors?

  • Default Constructor
  • Parameterized Constructor
  • Copy Constructor
  • Static Constructor
  • Private Constructor

Q6) What is String Builder? Which one Preferable string or String Builder?

String Builder is a dynamic object. Its allow number of characters in string. Its does not create a new object in memory.
StringBuilder sb = new StringBuilder(“Hi Team!!”);
We can prefer StringBuilder. Beacuse it performs faster than string when appending multiple string values.

Q7) What is Anonymous Functions?

Function without name is called Anonymous functions. Two types of anonymous functions.

  • Lambda Expressions
  • Anonymous Methods

Q8) What is Reflection?

It is a process to get metadata of a type at runtime. Few classes for reflection are below,

  1. Type
  2. Assembly
  3. Assembly Name

Q9) What is Abstract Class?

Its declared as abstract. It can have abstract and non-abstract methods. It cannot be instantiated. Its implementation must be provided by derived classes.

Q10) What is Sealed?

Its a restrictions of class and methods. Sealed class cannot be derived and Sealed method cannot be overridden.

Q11) What is Method overriding?

Derived class define same method as defined in base class. Its need to use virtual keyword with base class method and override keyword with derived class method.

public class Sample{
public virtual void message(){
Console.WriteLine("Hi Welcome");
}
}
public class SampleTwo: Sample
{
public override void message()
{
Console.WriteLine("Hello");
}
}
public class TestOverriding
{
public static void Main()
{
SampleTwo d = new SampleTwo();
d.message();
}
}

Q12) What is Encapsulation?

Its wrapping data into a single unit.

class Employee
{
public string ID { get; set; }
public string Name { get; set; }
}
class example
{
static void Main(string[] args)
{
Employee employee = new Employee();
employee .ID = "1";
employee .Name = "Anbu";
Console.WriteLine("ID = "+employee .ID );
Console.WriteLine("Name = "+employee .Name );         }
}

Q13) What are the filters in MVC?

  • Authentication
  • Authorization
  • Result
  • Action
  • Exception 

Q14) How we can use multiple model in Single view?

We can use multiple model in Single view using below things,

  • View Data
  • View Bag
  • Tuple
  • Dynamic Model
  • View Model

Q15) Major reasons to select dotnet framework to develop software?

It has rich GUI controls, secured, integrated with many Microsoft applications, scalability and stability, support many programming languages, rich SOLID principals, portable, it supports various architectures and design patterns, easy to maintain and deploy.

Q16) Reasons behind the top Enterprise applications are built on dotnet framework?

Easiest way to code with a powerful IDE (Visual studio), with better flexibility, rich development community, no compromise with the security, top deploying solution with Microsoft azure cloud integration.

Q17) Ways to achieve redirection from one page to other page in webforms

Page processing can be transferred from one page  to other page with the help of server.transfer without making a post back to the browser. Redirection of the page from another page can be achieved with the help of response.redirect which perform a post-back to the client browser.

Q18) How to make thread safe with collections.

By using the SynchronizedCollection<T> has a built-in synchronization object which can be used to make collection thread-safe, and this can be used for specific requirement.

Q19)What is the best approach to use collections in multi-threaded applications?

Immutable collection take a different approach in making collections thread-safe. As concurrent collections use synchronization locks instead, immutable collections can’t be changed after they are created. Automatically it makes them safe to use in multi-threaded scenarios since there’s no way for another thread to modify them and make the state inconsistent. This design decision definitely affects the API of immutable collection classes. They don’t even have public constructors.

Q20) What are Honest method or pure method?

Honest method is a function whose output depends on its input parameters and that does not have any side effects. Which means that a pure method cannot mutate an argument, cannot read or mutate global state, cannot read the system timer, cannot read or write file contents, cannot read from or write to the console, etc.

Q21)Why C# is a type safe language?

C# discourages or prevents data type errors, the data type error is un-desirable program behavior caused by variation between differing datatype for the program variables, constants and functions this is the reason behind C# a type safe language.

Q22) C# Types and type member signatures

The System.Object type is CLS compliant and it is base type of all object types in the .NET Framework type system. Inheritance in the .NET Framework is either implicit (for example, the String class implicitly inherits from the Object class) or explicit (for example, the CultureNotFoundException class explicitly inherits from the
ArgumentException class, that is explicitly inherited from the Exception class. For a derived type to be a CLS compliant, its base type must also be CLS compliant.

Q23) Intrinsic types which are not CLS Compliant in .net framework

The following intrinsic types are not CLS-Compliant.
SByte – 8-bit signed integer data type, TypedReference – Pointer to an object and its runtime type, Uint16 – 16-bit unsigned integer, Uint32 – 32-bit unsigned integer, Uint64 – 64-bit unsigned integer, UintPtr – Unsigned pointer or handle.le.

Q24) What are dynamic views.

Views that don’t declare a model type using @model but that have a model instance passed to them (for example, return View(Address)) can reference the instance’s properties dynamically. The feature offers flexibility, but it doesn’t offer compilation protection or IntelliSense. If the property doesn’t exist, then webpage generation fails at run-time.

Q25) Purpose of Generics.

Generic types to maximize code re-usability, type safety, and performance. The main common use of generics is to create collection classes. The .NET Framework class library contains many new generic collection classes in the System.Collections.Generic namespace. These can be used whenever possible instead of classes such as ArrayList in the System.Collections namespace. We can create our own generic interfaces, classes, methods, events and delegates. Generic may be constrained to enable access to methods on data types. The information on the types that are used in a generics data type may be obtained at run-time by using reflection.

Q26) What are delegates.

In .NET Framework delegates provide a late binding mechanism. it means which we create an algorithm where the caller also supplies at least one method that implements part of the algorithm. Consider sorting a list of stars in an astronomy program. we may choose to sort those stars by their distance from the earth, or the magnitude of the star, or their perceived brightness.

Q27) Explain the life cycle of a Winforms in .net?

The following steps are involved in the life cycle of the winforms in .net
Load: When the form is loaded in into application.
Activate: When the form gets focused when it loads for the first time.
Deactivate: When the form is not focused or minimized or sent to background.
Closing: Before closing the application, this functionality is invoked.
Closed: When application is closed.
Disposed of: Garbage collection performs once the application is closed.

Q28) How can we get the information from the form of a Dialog Box

By using the Form.ParentForm property of the dialog box we can access the public members of the form. And we can explicitly convert the reference returned by the ParentForm property to appropriate type.Below code will help us to demonstrate the ParentForm property to access a property from the form.

public void GetParent()
{
string x = ((Form1)this.ParentForm).Text;
}

Q29) How can we implement singleton design pattern in C#?

In The singleton design pattern, only one Instance of a class will be created and will be used to provide access point globally
Below code will demonstrate the Singleton Design Pattern in C#

public sealed class Singleton
{
private static readonly Singleton obj = new Singleton();
}

Q30) what are the commonly used exceptions in .Net?

OutOfMemoryException, ArithmeticException, NullReferenceException, OverflowException, InvalidOperationException, ArgumentException, DivideByZeroException,
IndexOutOfRangeException, InvalidCastException, IOEndOfStreamException, ArgumentOutOfRangeException, ArgumentNullException, StackOverflowException and so on

Q31)What are constructor overloading?

Defining multiple constructors with the same name within the same class but with different arguments in different sequence can be said as constructor overloading.

Q32) What are constructor chaining?

When a class constructor is invoking another class, constructor is called as constructor chaining. Base() can be used as constructor chaining.

Q33) Why we have “Main()” method as static method?

When we run the application the CLR will invoke Main(). If the Main() is a instance method it requires object. To succeed this, Main() method is defined as static method.

Q34) What is language In-dependency? Is dot NET language independent technology?

Dot Net will support multiple languages. When developing an application using dot net languages we can use another dot net language component.
Ex – When we develop C# dot Net application we can use vb.net component. As well as when we develop VB.Net application we can use C# dot Net component. Because of this reason dot net is independent technology.

Q35) What is Ispostback? When we will use Not Ispostback?

IsPostBack is the property of the web Page class which is used to determine whether the page is posted back from the client.  Whenever we don’t want to execute the code within the load event, then the page load event fires then we will use (!IsPostBack)

Q36) What is AutopostBack? when we will set Autopostback=true?

Autopostback is the property of the controls. If you need a control to post back automatically when an event is raised, we need to set the AutoPostBackproperty of the control as True.

Q37) How can we convert client-side control as server-side control? How can we convert server-side control as client-side control?

Yes. We can convert Client-side control as server-side control by adding an attribute runat= server But, we cannot convert server-side control to client-side control

Q38) When we will go for multiple web.config files?

Whenever we need to define some separate settings for couple of web pages, we can create a new folder and we can add those couple of web pages to that folder and we should add a new Web.config file to that new folder and we can define separate settings within that Web.config

Q39) What is the importance of machine.config? How many machine.config files can we have?

Machine.Config file, this file specifies the settings that are global to a particular system, Machine.config file is used to configure the application according to a
system. That is, configuration done in machine.config file is affected on any application that runs on a system. Usually, this file is not altered. We can have only one machine.config file in a system.

Q40) What are the main advantages and disadvantages of inproc session?

Advantages of Inproc Session are as follows

  1. Accessing the inproc session data will always be faster.
  2. It is always good for small web applications

Disadvantages of Inproc session are as follows

  1. It we restart the web server or if any crashes to the web server there is a chance of losing the session data.
  2. If the session data is increased there is a burden on the web server, it will affect the performance of web server and web application.
  3. It is not suitable for large web application models like web-garden and web-farm.

Q41) What are the Asp.Net page cycle stages?

There are overall 8 stages for any webpage in Asp.Net which will undergo within server at page life cycle.

  • Page Request
  • Start
  • Page Initialization
  • Load
  • Validation
  • PostBack Event Handling
  • Rendering
  • Unload

Q42) What is enum? What is the default data type of enum?

Enum is a value type. Enum is a collection of constants which means it is a collection of string constants which are representing collection of integer constants. Int is the default data type of enum.

Q43) How Can we pass 2 different type values to generic function?

We can pass 2 different type values to generic collection. Please find the below code which demonstrates

Class MyClass
{
Internal static void print <T, K> (Ta, Kb)
{
}
}
Class program
{
public static void Main ()
{
MyClass.print<int, string>(05,"Besant");
Console.ReadLine ();
}
}

Q44) How to send a thread for sleep?

By using Thread.sleep(), we can send a thread to sleep according to the given time. Sleep () method can be blocked the current thread for the specified number of milliseconds. In other words We can include specific time via thread.sleep() method as follows.
Thread.Sleep (TimeSpan.FromHours (1)); // sleep for 1 hour
Thread.Sleep (1000); // sleep for 1000

Q45) What are the different types of literals in dotnet

Boolean literals: False or True are literals of the boolean type which map to the 0 and 1 state, respectively. Integer literals: Interger is used to have values of types Int, ulnt, long, and ulong. Real literals: Real is used to have values of types float, double, and decimal. Character literals: character represents a single character and usually consists of a character in single quotes, such as ‘a’. String literals: Dotnet supports 2 types of string literals, regular string literal and verbatim string literals. A regular string consists of zero or more characters within the double quotes, such as “543234”. A verbatim string literal is of an @ character followed by a double–quote character, such as @”This is litrals”. The Null literal: Represents the null–type.

Q46) Can I declare a method as sealed?

No, In C# a method cannot be declared as sealed. But when we override a method in a derived class, we can declare the overridden method as sealed. By declaring it as sealed, we can avoid further overriding of the sealed method.

Q47) Suppose we need a certain ASP.NET function to be executed on mouse-over over a certain button or textbox. Where do we add an event?

Each web control has an ability to add the attributes on client side that will execute on client side and run a client-side script like a JavaScript function.
Ex – btnSubmit.Attributes.Add (“onMouseOver”,”someClientCode();”)
TextBox.Attributes.Add(“onFocus”,”ClearText();”)

Q48) What does a keyword using works for?

Using is a convention or a short-cut method which allows us to access the classes in a namespace by referencing it on top of the class. whenever we need to use the classes or methods from the namespace, we can avoid typing the entire namespace hierarchy.

Q49) What is Method Hiding in C#?

If the child class don’t want to use methods from the base class, child class can implement its own version of the same method with same signature. For example, in the classes below, Pipedrive () is implemented in the child class with same signature. This can be called as Method Hiding.

class Car
{
public void TypeOfDrive()
{
Console.WriteLine("Right Hand Drive");
}
}
class Ford : Car
{
public void TypeOfDrive()
{
Console.WriteLine("Right Hand ");
}
}

Q50) Can we create custom exception in dotnet. And How can we create?

Yes, Custom Exception class is nothing but a user defined class which is derived from System Exception class. Below are the steps, Custom class can be derived from System Exception class. By Creating a constructor of custom class with error message parameter and we can pass it to the base class (System Exception class). Then throw and catch custom exception message in try-catch block in code wherever it is required.

Q51) What is strongName in Assembly?

When you create the assembly name in gacutil , that will be create the unique name where you can deploy in the Gac util . It will also help out it with two different version of assembly.

Q52) What is diferent types of Action result in MVC?

View ,PartialView ,File,Redirect,Content,Json and redirectToRoute. This help to achieve the different set of actionresult in MVC . It will implement in the controlaction method and in order to achieve these method.

Q53) What is purpose of cookeis

It will the stored information on the local machine or client machine , where the user access the webpage in the system .

Q54) Why we should avoid autopost back in asp.net ?

This autopost back will taken  care by the asp.net server , in turn automatically hits the server and performance action . It will reduce of performance of applications.

Q55) Why we should avoid the roundtrip action in net

When the user has access request and made to the system , so the request will go from client to server and go back from server to client , thus making to and for action in the system.

Q56) How do you know the default viewstate is enable or not?

By default the view state has been enabled. In order to disable the view state by specifying the property at header level.

Q57) What is the specific features in web service?

The web service will able to support for multiple platforms and different languages and it will able to exchange the data with different system.

Q58) What is data type for int,string,varchar

Bigint – 8 bytes
Int – 4 bytes
smallInt- 2 bytes
TinyInt –  1 bytes

Q59) What is maximum of datelength varchar in the sql server

8000 datelength

Q60) What is the purpose of recursive stored procedure

It can be achieved by reclusive method stored procedure by calling  recrusive in built stored procedure

Q61) When you should use sql profiler and what is the purpose of sql profiler.

It is used to capture the trace of the sql query log as background process in the table and database engine.

Q62) Can we variable across all the session in the sql server?

Yes, by using the global variable across all the session

Q63) What is the use of constraints in the SQL server

This constraints nothing but it will rule to enforce the rule on the table, like null constrinats , referential constriants , primarykey  constriaints . If any of these rull will violate the rule , it will throws as error message.

Q64) Can we linked to another sqlserver from different sql server?

It can be connected by using the linked server properties.

Q65) Do you know anything about the sql server agent and what is the use of sql server agent?

It will help to performance the administration activities like job scheduler, which run on daily actives for pulling the records

Q66) Can we check the logs in the table and what the action will performed ?

By using command sp_lock

Q67) When you will use authentication and authorization?

Authentication will identify the username and password and the process of identity. Authorization are used to granting the access to the user  based on identity and allowing the specific access to the application .

Q69) What will be default timeout for cookies ?

The duration would be 30 minutes.

Q69) Which properties you will use tag hyperlink in the datagrid ?

Asp:Hyperlink

Q70) How many programming language will .net support , please mention in below

VB.Net,C#,Cobel,F#,perl . As per recently release it will support 44 languages

Q71) What kinds of event handlers in the global asax files ?

These event handler are available in the global asax file are mention in below:
Application_start,application_end,session_start,session_end

Q72) What is the use of custom validator in asp.net

The custom validator can written by use logic in both server and client side application

Q73) How will manage the session in asp.net and what are object can be used to access the application?

Viewstate,Querystring,Cookies,Session and application

Q74) Whether the webapplication will run without web.config in asp.net application?

Yes. It will be run in .net application .

Q75) Can we add the files in the app_code folder files?

The file should be same language , that will be supported.

Q76) Which protocol will support webservice ?

Only Http protocol will support.

Q77) Could please explain about the webconfig and machine config ?

Webconfig are used to confrigue the webapplication and machine config are used to confrigure the machine or server system .

Q78) Explain about the cross page posting in .net application and why so it important ?

When you submit the page with different domain or different url ,actually it will goes from one domain into another domain .

 Q79) What do you mean by strong type and weak type

The code will complie are used to checked at the compile time is called strong type. The Weak type will compile at the runtime of program .

Q80) What will be application setting in web.config file?

It will use to specific settings in the db connection string.

Q81) What are object avaibable in Ado.net ?

Dataset,DataReader,DataAdapter,Command,Connection

Q82) Why we should try and catch block in .net?

In order to handle .net exception, instead of throwing exception, it will catch and log the error message in the system.

Q83) Why we should use “Using” in c# ?

It will automatically take the dispose of object for unmanaged application , when we are using ado.net object while implementing the methodology.

Q84) How constant and read only will be different from each other?

Const cannot change the value and even latter module also.
Readonly constant can be change at the runtitme .

Q85) What is the main principle of oops in .net ?

Inheritance,Encapsulation,Polymorphism and Abstraction are used to achieve the core principle of object oriented language.

Q86) What is new features in asp.net 2017

It will support in all operating system like windows,MAC and linux environment

Q87) How will achieve the fetch data from database without any postback .

It can be achieved by jquery library.

Q88) How you will increase the performance of application in .net application and what are criteria will be consider while preparation of design of application .

Implementation of caching, Disabling the view state, implementation of stored procedure, Implementation of design patterns , creation of non-clustered index on table which frequently accessing the tables, creation of pagination (instead of avoiding  all the data in single page)
Disposing the object of unmanaged code.

Q89) Explain about the method overriding

Public Class Parent{
Public void mymethod()
{
  Console.Write(“Parent Class”);
}
}
Public Class Child:Parent {
Public void override mymethod()
{
   Console.write(“Child Class”)
}
}
  //Just overring the implementation in child class
Static void Main()
{
   Parent  objParent = new Parent()
   objParent.Mymethod(); // Output : Parent Class
   Child objChild = new Child();
   objChild.MyMethod(); // Output : Child Class    
 }

Q90) Explain about the method overloading

Public  class  Mycalcuation
{
Private int a;
Private int b;
Private int c;
Public int Add(int a,int b)
{
Return a+b;
}
Public int Add(int a,int b,int c)
{
 Return a+b+c;
}
}
Static void Main()
{
 MyCalculation objCalc= new MyCalculation();
ObjCalc.Add(2,3) 
// It will call first method Add which has two argument
ObjCalc.Add(2,3,4)
// It will call Second method Add which has
three argument eventhough it has same name
}

Q91) When you will go for Webapi or WCF service .

If you want any service wants to support multiple platform like http and tcp id based , then we will go for WCF service , because same service will exposed with different service, whereas the webapi will support only http based protocol.

Q92) what is CLR ?

When you are write the program in any language like c#,vb.net,F# , that language will be convert into micrsoft intermediate language , that will further convert into target machine , these operation will be performed by CLR.  It has consider as heart of .net framework which take care of allocation memory , compilation of code and deallocation of memory.

Q93) What is Garbage collector ?

Whenever object of memory was not disposed properly, the Garbage collector will be automatically disposed the object by checking whether the object had reference in the memory or not. These Garbage collectors will keep on checking the memory with specific span of time

Q94) What is the advantages in MVC compare to asp.net

Separation of module for each task like UI,Buiness logic and data compare to asp.net and easy to maintain. Test module with separate of test case.

Q95) What is difference between string and string builder

String a =”GangBoard”;
String b =”Online Training”
 Stirng C = a + b ;  
 it will create three separate memory in the Heap
Whereas
Stringbuilder s = new stringbuilder();
s.append(“GangBoard”);
s.append(“Online Training”);
//It will create single instance memory in the Heap

Q96) How to replicate the production issue in UAT or Dev , for fixing the bugs and what will be approach ?

Try to understand the client navigate page in the application and similarly steps should be followed in order to reproduce this issue

Q97) What is boxing and unboxing

Boxing is used convert value to reference type. For example

Int x =10
Object x = (object) x;   //converting the integer to object type.
Object Myclass;
MyClass =87;
Int y = (Int )y;

Q98)Can sealed class can be inherited?

Public class sealed ParentClass {
Public void Method1()
{
}
 }
Public class MyChildClass:
ParentClass  -> It will throw the error due to sealed class ,
it will allow to inherited in the child class
{
   Public Void Method2()
  {
  }
}

Q99) How will debug the jQuery value in the browser and how will follow steps up

By using the developer tools and specifying the debugger in the browser tools and debugs by step by steps.

Q100) For specific age property in the application, which data type you will use

Byte -> 0 to 128 and without negative , whereas the integer have –negative and positive value as data range.

Q101) How will you enforce garbage collection in .NET.?

System.GC.Collect();

Q102) Difference between Managed and Unmanaged Code in .Net?

C# compiler creates managed code. For unmanaged code, the application has to be written in C or C++.

Q103) What are the access modifiers for the items used in C# interface?

The item members in the interface don’t have any access specifier, by default they are public.

Q104) What is Interface in .Net?

An interface looks like a class that can have a set of properties, methods, events and indexers, but has no implementation.

Q105) How will you prevent a class from being inherited in C#?

In C#, use the sealed keyword.

Q106) Give the differences between the stack and heap?

Stack is allocation in the memory where value types are stored. Heap is a memory allocation where the reference types are stored.

Q107) Difference between String and StringBuilder?

String is an immutable object and StringBuilder is a Mutable Object. Performance wise string is slow because its’ create a new instance to override or change the previous value.

Q108) What is the use of a finally block in exception handling?

Finally block is used to free resources such as database connection , objects used within the try block.

Q109) How will you disable the session?

In webconfig file SessionState=Off

Q110) Overhead of using Session?

Performance issues if large Volumes of data/user , because session data is stored in server memory.Also overhead in serializing ad Deserialization of session data from server.

Q111) What is the use of appsetting tags in web.config?

App settings tag helps us to store the application settings information like Connection Strings, file Paths, URLs, Port Numbers, etc.

Q112) How many Web.config file is allowed in asp.net web application?

Any number of web.config files  can be used

Q113) Use of script manager in AJAX?

It is the important parent control . This control contains all the Ajax related Methods and properties.

Q114) When do we use abstract classes?

Whenever some methods in the current class can be implemented now and fewer methods which can be implemented in the future then those needs to be declared as abstract class.

Q115) What are type safe function pointers?

In C# delegates are type safe function pointers which delegate declaration follow the method declaration.

Q116) Why Partial Class is used?

When multiple resources wants to work on a single class then we can declare that class as partial class.

Q117) Is it possible to convert server side control to client side control?

No. its not possible but the vice versa is possible by adding an attribute called runat=”server”

Q118) Difference and usage of LINK and Hyperlink button?

Hyperlink will not perform postback whereas Link button will postback the webpage to the server.

Q119) When we will use passport authentication?

Group of websites which allows a single user with single User id and password.
Each part of a partial class should be in the same namespace, same assemebly.

Q120) The XML document and XML reader are different?

XML document: The contents of an xml file in memory, starting from storage, are activated.
XMLReader: a reader that provides the speed, noncached, forward access to an XML web page

Q121) When the lock key is used?

The lock material ensures that the text does not include the key portion of a thread code, another thread is in the critical section. When any other text attempts to enter a locked code, it will prevent and block until the material is published.

Q122) Difference between thread and process?

Threads are usually made for small tasks, whereas processes are used for more ‘heavyweight’ tasks – basically the execution of applications

Q123) Difference between a.equals(b) and a==b?

a==b compares the reference values whereas Equals() compares only contents.

Q124) Is string a value type or reference type?

String is a reference type with no default size and value stored in Heap.

Q125) What is the difference between webpage Set and webpage Table?

Indicates the webpages table in the webpage. It has rows and columns. There is no difference between data sets and datatable, the database is a set of webpages.

Q126) What’s the difference between fixing and output creation?

Creating the creation of programmers and creating the output for the preparation of the final creation.

Q127) Early binding and late binding?

Method call at runtime is late binding (Method Overriding) Method call at compile time is called early binding (Method Overloading)

Q128) Idisposable interface . How it is used?

Idisposable interface contains dispose method to release unmanaged resources like streams , database connections.

Q129) Whatever asp: controls would you ever use in production?

Repeater asp:placeholder asp:literal

Q130) What are the extensions in C #?

Extension methods allow the classes to extend the class source of the class, rather than relying on legacy.

Q131) Limitations in using Params Keyword?

Once the Param keyword is used in method declaration additional parameters are not allowed.
Params type can only be single dimensional array.

Q132) What is AppDomain?

Application domain is a light weight process which is a container for both data and code and provides secure boundary.CLR allows multiple .net applications to be run in one App domain.

Q133) Maximum pool size in ado.net connection string?

DefaultMAX pool size is 100 and can increase the size to its maximum limit.

Q134) Difference between LINQ and SQL Stored Procedure?

LINQ Based Solution deployment is easier than using Stored procedures. LINQ uses .NET debugger and supports multiple databases. Whereas Stored Procedures need to be rewritten for multiple databases.
Q135) What is the use of Data View?
Data View is used for Filtering and sorting data in Data Table.

Q136) What is a Jagged array?

A jagged array is an array whose members are arrays. The members of a jagged array can be of different dimensions and sizes.

Q137) ref & amp; What are the parameters?

The argument which needs to be re-evaluated before the execution of the method does not need to be begun earlier.

Q138) What Are the C # Attributes and Its Importance?

C # developers are in specific companies eg Provides a way to define notification tags. Class, method are called attributes. Using the mirror, the movement of information can be obtained at the moment.

Q139) What is difference between constants and read-only?

Constant variables are declared & initialized at compile time. The value can’t be changed afterwards. Read only is used wrhere the value can be changed during run time o when we want to assign the value at run time.

Q140) What is the .Net structure?

It is a stage for structure different applications on windows. It has a rundown of inbuilt functionalities as class, library, and APIs which are utilized to construct, convey and run web administrations and various applications. It bolsters various dialects, for example, C#, VB .Net, Cobol, Perl, and so forth. This system supports object-situated programming model.

Q141) What are the significant parts of .Net?

The parts of .Net are Common language run-time, .Net Class library, Application area, Common Type System, .Net structure, Profiling, and so forth. Be that as it may, the two significant parts are the Class library and the Common Language Runtime.
CLR gives building squares to a wide assortment of utilizations. The class library comprises of a lot of classes that are utilized to get to basic usefulness. The usefulness can be shared among various applications.

Q142) What is CTS?

CTS represents Common Type System. It has a lot of standards which state how an information type ought to be proclaimed, characterized and utilized in the program. It depicts the information types that are to be utilized in the application.
We can structure our classes and qualities by following the standards that are available in the CTS. The standards are made with the goal that the information type proclaimed utilizing a programming language is callable by an application that is created utilizing an alternate language.

Q143) What is CLR?

CLR represents Common Language Runtime. It is a standout amongst the most significant segments of the .Net structure. It gives building squares to numerous applications.
An application assembled utilizing C# gets ordered by its compiler and is changed over into an Intermediate language. This is then focused to CLR. CLR does different activities like memory the board, Security checks, congregations to be stacked and string the executives. It gives a protected execution condition to applications.

Q144) What is CLS?

CLS represents the Common Language Specification. With the principles referenced under CLS, the designers are made to utilize the parts that are between language good. They are reusable over all the .Net Compliant dialects.

Q145) What is JIT?

JIT represents Just In Time. JIT is a compiler that changes over Intermediate Language to Native code.
The code is changed over into the Native language during execution. Local code is only equipment determinations that can be perused by the CPU. The local code can be put away with the goal that it is available for ensuing calls.

Q146) What is MSIL?

MSIL represents Microsoft Intermediate Language.
MSIL gives guidelines to calling strategies, introducing and putting away qualities, activities, for example, memory dealing with, special case taking care of, etc. Every single .Net code are first gathered to IL.

Q147) What is implied by Managed and Unmanaged code?

The code that is overseen by the CLR is called Managed code. This code keeps running inside the CLR. Henceforth, it is important to introduce the .Net structure to execute the oversaw code. CLR deals with the memory through trash accumulation and furthermore utilizes different highlights like CAS and CTS for proficient administration of the code.
Unmanaged code is any code that does not rely upon CLR for execution. It implies it is created by some other language free of the .Net structure. It utilizes its runtime condition for arranging and execution.
In spite of the fact that it isn’t running inside the CLR, the unmanaged code will work appropriately if the various parameters are effectively pursued.

Q148) How is a Managed code executed?

Following advances are pursued while executing a Managed code:

  •  Choosing a language compiler relying upon the language wherein the code is composed.
  •  Converting the above code into Intermediate Language by its compiler.
  •  The IL is then focused to CLR which changes over the code into local code with the assistance of JIT.
  •  Execution of Native code.

Q149) What is ASP.Net?

ASP .Net is a piece of .Net innovation and it involves CLR as well. It is an open source server-side innovation that empowers the developers to assemble amazing web administrations, sites and web applications.

Q150) Explain State the executives in ASP .Net.

State Management means keeping up the condition of the article. The article here alludes to a page/control.
There are two sorts of State the executives, Client Side, and Server side.

Q151) What is an Assembly? What are the various kinds of Assemblies?

An Assembly is an accumulation of intelligent units. Sensible units allude to the sorts and assets which are required to assemble an application and send them utilizing the .Net structure. The CLR utilizes this data for sort usage. Get together is a gathering of Exe and Dlls. It is compact and executable.
There are two sorts of Assemblies, Private and Shared.

  • Private Assembly, as the name itself recommends, it is available just to the application. It is introduced in the establishment catalog of the Application.
  • A Shared gathering can be shared by numerous applications. It is introduced in the GAC.

Q152) Explain the various pieces of an Assembly.

The various pieces of an Assembly are:

  •  Manifest – It contains data about the adaptation of a get together. It is likewise called get together metadata.
  •  Type Metadata – Binary data of the program.
  •  MSIL – Microsoft Intermediate Language code.
  •  Resources – List of related records.

Q153) What is an EXE and a DLL?

Exe and DLLs are Meeting executable modules. Exe is an executable record. This runs the application for which it is planned. An Exe is created when we construct an application. Consequently the gatherings are stacked legitimately when we run an Exe. In any case, an Exe can’t be imparted to different applications.
DLL represents Dynamic Link Library. It is a library that comprises of code which should be covered up. The code is embodied inside this library. An Application can comprise of numerous DLLs. These can be imparted to different applications also.
Different applications which need to share this DLL need not stress over the code complexities as long as it can call the capacity on this DLL.

Q154) What is Caching?

Reserving means putting away information briefly in the memory so the application can get to the information from the store as opposed to searching for its unique area. This expands the exhibition of the application and its speed. System.Runtime.Caching namespace is utilized for Caching data in .Net.
Given beneath are the 3 unique sorts of Caching:

  •  Page Caching
  •  Data Caching
  •  Fragment Caching

Q155) What is MVC?

MVC represents Model View Controller. It is a structural model for structure the .Net applications.
Models – Model articles store and recover information from the database for an application. They are normally the coherent pieces of an application that is actualized by the application’s information space.
View – These are the segments that show the perspective on the application as UI. The view gets the data from the model items for their showcase. They have segments like catches, drop boxes, combo box, and so on.
Controllers – They handle the User Interactions. They are in charge of reacting to the client inputs, work with the model items, and pick a view to be rendered to the client.

Q156) What is the distinction among Function and Stored methodology?

Put away Procedure:

  •  A Stored strategy is constantly used to play out a particular undertaking.
  •  It can return zero, one or more worth.
  •  Exception dealing with should be possible utilizing an attempt catch square.
  •  A capacity can be called from a Procedure

Capacities:

  •  Functions must restore a solitary worth.
  •  It can just have the info parameter.
  •  Exception taking care of is impossible utilizing an attempt catch square.
  •  A Stored methodology can’t be called from a capacity.

Q157) Explain CAS (Code Access Security).

.Net gives a security model that forestalls unapproved access to assets. CAS is a piece of that security model. CAS is available in the CLR. It empowers the clients to set authorizations at a granular dimension for the code.
CLR then executes the code contingent upon the accessible consents. CAS can be connected distinctly to the oversaw code. The unmanaged code keeps running without CAS. In the event that CAS is utilized on congregations, at that point the gathering is treated as somewhat trusted. Such gatherings must experience checks at whatever point it attempts to get to an asset.
The various parts of CAS are Code gathering, Permissions, and Evidence.
Proof To choose what consents to give, the CAS and CLR rely upon the predefined proof by the get together. The examination of the get together gives insights concerning the various bits of proof. Some normal proof incorporates Zone, URL, Site, Hash Value, Publisher and Application catalog.
Code Group – Depending on the proof, codes are put into various gatherings. Each gathering has explicit conditions connected to it. Any gathering that matches those condition is put into that gathering.
Consents – Each code gathering can perform just explicit activities. They are called Permissions. At the point when CLR loads a get together, it matches them to one of the code gatherings and recognizes what activities those congregations can do. A portion of the Permissions incorporate Full Trust, Everything, Nothing, Execution, Skip Verification, and the Internet.

Q158) What is GAC?

GAC represents Global Assembly Cache. At whatever point CLR gets introduced on the machine, GAC comes as a piece of it. GAC explicitly stores those congregations which will be shared by numerous applications. A Developer apparatus called Gacutil.exe is utilized to add any record to GAC.

Q159) What is implied by Globalization and Localization?

Internationalization is the way toward planning applications that help different dialects. This

Q160) What is the incredible practice to realize endorsements in aspx page?

Client side endorsement is the best way to deal with favor data on a site page. It diminishes framework traffic and extras server resources.

Q161) What are the event handlers that we can have in Global?asax report?

Application Events: Application_Start , Application_End, Application_AcquireRequestState, Application_AuthenticateRequest, Application_AuthorizeRequest, Application_BeginRequest, Application_Disposed, Application_EndRequest, Application_Error, Application_PostRequestHandlerExecute, Application_PreRequestHandlerExecute,Application_PreSendRequestContent, Application_PreSendRequestHeaders, Application_ReleaseRequestState, Application_ResolveRequestCache, Application_UpdateRequestCache
Session Events: Session_Start,Session_End

Q162) Which show is used to call a Web organization?

HTTP Protocol

Q163) Would we have the option to have various web config records for an asp.net application?

Really.

Q164) What is the refinement between the web config and machine config?

The web config record is unequivocal to a web application through a machine config is express to a machine or server. There can be distinctive web config reports into an application however we can have only one machine config record on a server.

Q165) Explain work based security?

Employment Based Security used to complete security reliant on occupations selected to customer packs in the affiliation.
By then, we can allow or deny customers subject to their activity in the affiliation. Windows describes a couple of intrinsic social affairs, including Administrators, Users, and Guests.

<AUTHORIZATION>< endorsement >
< license roles="Domain_Name\Administrators"/> < !- - Allow Administrators in space. - >
< deny users="*"/> < !- - Deny some other individual. - >
</endorsement >

Q166) What is Cross Page Posting?

When we snap submit get on a site page, the page shows the data in the understanding. The method where we present the data on different pages is called Cross Page posting. This can be cultivated by setting POSTBACKURL property of the catch that causes the postback. The mind control method for PreviousPage can be used to get the posted characteristics on the page to which the page has been posted.

Q167) By what method may we apply Themes to an asp.net application?

We can decide the theme of the web.config archive. Coming up next is the coding manual for apply the subject:

<configuration>
<system.web>
<pages theme="Windows7"/>
</system.web>
</configuration>

Q168) What is RedirectPermanent in ASP.Net?

RedirectPermanent Performs an unchanging redirection from the referenced URL to the foreordained URL. At the point when the redirection is done, it in like manner returns 301 Moved Permanently responses.

Q169) What is MVC?

MVC is a structure used to make web applications. The web application base develops the Model-View-Controller structure which confines the application justification from UI, and the data and events from the customer will be obliged by the Controller.

Q170) Explain the working of visa confirmation.

Above all, it checks the universal ID affirmation treat. In the event that the treatment isn’t available, by then the application redirects the customer to Passport Sign on the page. Universal ID organization checks the customer nuances on a sign on page and if authentic, by then stores the approved treat on the client machine and after that occupy the customer to the referenced page.

Q171) What are the advantages of Passport check?

All of the locales can be gotten to using single login accreditations. So no convincing motivation to review login accreditations for each site.
Customers can take care of his/her information in a singular territory.

Q172) In which event are the controls totally stacked?

Page burden event.

Q173) what are boxing and unloading?

Boxing is doling out a value kind to reference type variable.
Unloading is pivot of boxing ie. Consigning reference type variable to regard type variable.

Q174) Separate strong making and fragile creating

In strong making, the data sorts of the variable are checked at accumulate time. On the other hand, in case of slight making, the variable data types are checked at runtime. Because of strong making, there is no chance to get of array botch. Substance use feeble forming and from this time forward issues rise at runtime.

Q175) How we can propel all the endorsement controls to run?

The Page. Validate() technique is used to drive all the endorsement controls to run and to perform endorsement.

Q176) Rundown all layouts of the Repeater control.

  •  ItemTemplate
  •  AlternatingltemTemplate
  •  SeparatorTemplate
  •  HeaderTemplate
  •  FooterTemplate

Q177) Rundown the major inherent articles in ASP.NET?

  •  Application
  •  Request
  •  Response
  •  Server
  •  Session
  •  Context
  •  Trace

Q178) Could You Explicitly Call A Destructor?

No, you can’t expressly call a destructor. Destructors are conjured naturally by the city worker.

Q179) What is the contrast among a Html Input Checkbox control and a Html Input Radio Button control?

In Html Input Check Box control, numerous thing choice is conceivable while, in HtmlInputRadioButton controls, we can choose a lone a solitary thing from the gathering of things.

Q180) Which namespaces are important to make a confined application?

System.Globalization
System.Resources

Q181) What are the various sorts of treats in ASP.NET?

Session Cookie – Resides on the customer machine for a solitary session until the client does not log out.
Tenacious Cookie – Resides on a client’s machine for a period indicated for its expiry, for example, 10 days, one month, and never.

Q182) What is the document expansion of web administration?

Web administrations have document expansion .asmx…

Q183) What are the segments of ADO.NET?

The parts of ADO.Net are Dataset, Data Reader, Data Adaptor, Command, association.

Q184) What is the contrast among ExecuteScalar and ExecuteNonQuery?

ExecuteScalar returns yield esteem though ExecuteNonQuery does not restore any worth but rather the quantity of columns influenced by the inquiry. ExecuteScalar utilized for getting a solitary worth and ExecuteNonQuery used to execute Insert and Update explanations.

Q185) Distinction between Abstract Classes and Interfaces.

Following are the contrasts between Abstract Classes and Interfaces:
At the point when a got class is acquired from an Abstract class, no different class can be broadened at that point. The interface can be utilized in any situation.
Conceptual class contains a theoretical strategy, for example genuine execution rationale. Then again, interfaces have no usage rationale.
Each strategy in an interface must be conceptual. This isn’t essential on account of unique classes.

Q186) What is an Assembly?

In the .NET system, a gathering is a somewhat incorporated code library for use in arrangement, forming, and security. There are two sorts: process congregations (EXE) and library gatherings (DLL). A handling get together speaks to a procedure which will utilize classes characterized in library gatherings. .NET gatherings contain the code in CIL, which is generally created from a CLI language and afterward accumulated into machine language at runtime by the CLR without a moment to spare compiler.
A get together can comprise of at least one documents. Code documents are called modules. A get together can contain more than one code module and since it is conceivable to utilize various dialects to make code modules it is actually conceivable to utilize a few unique dialects to make a gathering. Visual Studio, in any case, does not bolster utilizing various dialects in a single gathering.

Q187) What are the different items in Dataset?

The DataSet class exists in the System. Information namespace.
The Classes contained in the DataSet class are:

  •  DataTable
  •  DataColumn
  •  DataRow
  •  Requirement
  •  DataRelation

Q188) What is a NameSpace?

A namespace is a gathering of classes, structures, interfaces, identifications, and representatives, composed in a consistent chain of command by capacity, that empower you to get profoundly usefulness you need in your applications.
Namespaces are the way that .NET keeps away from name conflicts between classes. A Namespace is close to a gathering of information types, however it influences that the names of all information types inside a namespace naturally get prefixed with the name of the namespace. It is additionally conceivable to settle namespaces inside one another.

Q189) What is the distinction among NameSpace and Assembly?

A Namespace is a legitimate naming plan for sorts where a basic kind name, for example, MyType, is gone before with a spot isolated various leveled name. Such a naming plan is totally leveled out of the engineer. The .NET Framework utilizes a various leveled naming plan for gathering types into intelligent classes of related usefulness, for example, the ASP.NET application system, or remoting usefulness. Configuration apparatuses can utilize namespaces to make it simpler for engineers to peruse and reference types in their code.
The idea of a namespace isn’t identified with that of an Assembly. A solitary gathering may contain types whose various leveled names have diverse namespace roots, and a consistent namespace root may traverse numerous congregations. In the .NET Framework, a Namespace is an intelligent structure time naming accommodation, while an Assembly builds up the name scope for sorts at run time.