Share on Facebook
In the series of technical interview question, this is my fourth post. Here i am posting very basic questions related with .NET concept. Following questions are kind of introductory and usually asked in any .NET interview.
Que1:What are access specifiers?
Ans: Access specifiers are provided by .NET to achieve security of object and its member. It is important if you are doing some object oriented work.
Que2: What are the access specifiers provided by .NET?
Ans: There are five access specifiers in c#:
public : The type or member can be accessed by any code in the same assembly or another assembly that references it.
private : The type or member cannot be accessed outside the class.
protected : The type or member are accessible within the class or struct and the class derived (Inherited )from this class.
internal : The type or member are accessible within same assembly level.
protected internal : The type or member can be accessed anywhere in the same assembly and in the derived class.
Que3: What is XMLHTTPRequest object?
Ans: XMLHttpRequest is an API available in web browser scripting language to make Ajax calls. It sends HTTP or HTTPS requests to web server and load server response.
Que4: XMLHTTPRequest is a browser property or a part of HTML DOM?
Ans: It is browser property.
Que5: What are generics?
Ans: Generics is a way provided by .NET(Or JAVA) to define a classes or methods(or Interface) that can have placeholders (type parameters) for one or more of the types. In simple words Generics are the way to define any logic without worrying about the type. At run time it can take the type and can apply the logic on it(Of course some compile time check will be there by compiler).
Que6: Why Generics?
Ans: There are few advantages of having Generics.
a) Type safety: There is compile time checking done,which prevents developer to caste wrong type,and prevents run time exception.
Ex:
int i = 5;
Object o = i;
String str = (String)o;
Code written above causes problem at run time.
b) performance:Without generics i.e. with object class we need a lot of boxing/unboxing, causing performance degradation.
c) Source code protection: Developers don't need any source code if they are using generic algorithms.
Que7: What are LINQ?
Ans: LINQ: Language Integrated query. It is similar to database query but you can use it in .net to filter the desired data from any (IEnumerable)collection.
Que8: What are advantages of having LINQ?
Ans: LINQ is very much declarative,so it is easier to write and understand. The protection and optimization provided by framework is also a big advantage.
Que9: What is AppDomain?
Ans: AppDomain is logical container for set of assemblies.It is kind of shell to make application secure. In .NET Dll get loaded inside AppDomain of corresponding application. It can also be interpreted as isolation of memory used by application.
Que10: What is difference between AppDomain and a process?
Ans: The purpose of both AppDomain and process is to provide security but at different level. A process is Operating System level concept whereas AppDomain is .NET level concept. An AppDomain can belong to only one process, but a process can have more than one AppDomain in it.
Please go through the questions. The answers given are a little short and doesn't give the detail explaination. The topics covered here are very important, and i will suggest you to explore them in detail.