cognizant Dotnet interview Questions

Cognizant Dotnet interview Questions


Please friends to contribute questions of company interviews you attended mail us cinterviews.blogspot.com@gmail.com it will be useful for our job search community.www.cinterviews.com appreciates your contribution

Question. What is Deep copy and shallow copy?
Answer. Deep copy, copy the whole object and make a different object, it means it do not refer to the original object while in case of shallow copy the target object always refer to the original object and changes in target object also make changes in original object.

Question. how to Create custom collection?
Answer. using System.Collections namespace we can create the our custom collection classes.

Question. how to Bind grid with business obj?
Answer. return the dataset or datatable from business object and assign to datasource of grid.

Question. What is Singleton and how to implement locking in singleton pattern?
Answer. Singleton pattern usage a class which can contain only one object through out the application.

class my_Singleton
{
private static my_Singleton obj;
protected my_Singleton
{
}
public static my_Singleton Instance()
{
lock{
if (obj == null)
{
obj= new my_Singleton();
}
}
return obj;
}
}

Question. What is Typed dataset?
Answer. typed dataset is a normal dataset having property to data type check for Colum values and can access the columns by column names.

Question. What is Using keyword?
Answer. using keyword can be used in two format
1. include the namespace in file
2. handle the idisposable objects inside using block.

iFace obj = new myclass()

Myclass obj1 = new myclass()

Obj.hey();
Obj1.hey();

is the above code is valid?
yes

Question. What is difference between lock vs static locks?
Answer. static lock is applicable to static methods and variables.

Question. What is suppressfinalize?
Answer. We use this method to not to call the finalize method while disposing the objects.

Question. Can we inherit a class from multiple interfaces?
Answer. yes

Question. suppose two interfaces have same method, so how will you implement these methods in derive class?
Answer. by using interface name

Please friends to contribute questions of company interviews you attended mail us cinterviews.blogspot.com@gmail.com it will be useful for our job search community.www.cinterviews.com appreciates your contribution

No comments:

 
Top Blogs