Friday, May 27, 2011

Interview Questions H.. 12

1)Write a query to get the fifth higest salary froma table.
Ans. Select min(custkey) from (Select top 5 * from Customers order by custkey desc) as topfive

2) Difference between Class and object.
Ans. Class is a collection of functions and data(variables) while object is away to access those functions and variable.

3) What are the different properties of OOPS?
1) Encapsulation 2) Inheritance 3) Polymorphism 4) Abstraction

4) Trigger on Log on
Ans. Yes we can create Log On Trigger in SQL 2005. It will fire whenever any one will login. But there some problem I have notice it is doing multiple entries for one login, 3 for me.

5) Trigger on ddl.
Ans. Yes we can create Trigger on DDL in SQL 2005.

6) Which one is saved in memory object or class?
Ans. Please let me know if you find the answer.

7) What is serialization? And why we use it?
Ans. To save the state of object in a form that can be save in memory or transfer through wire.It is called serialization. We use this in games to save the intermediate state of game or any other place where is required.

8) What is Reflection?
Ans. Reflection is used to call an assembly or class functions dynamically. Or to access any other information from assembly.

9) What is Singleton Patter?
Ans. Single Pattern to strict the creation of object ( only one object). This can be achieved using private constructor. Singlton

10) What other design pattern you know?
Ans. 1) Iterator Pattern 2)Abstract Factory 3) Factory Pattern.4) Prototype Pattern

11) C# is case sensitive ?
Ans. Yes

12) VB.Net is case sensitive ?
Ans. No

13) Join
Ans. Click here

14) Garbage Collection.
Ans. Click here for detailed explanation

15) Difference between hiding and overriding.
1) When you want a same name function in child class without overriding than you can hide the function. Hide function is completely new function for child there is no relation of this method to base class. Both methods signature can be different.
2)For Hiding we use new keyword while for overriding we use override keyword. Hiding is also applicable by default.
3)If you have assigned child class reference to base class variable it shows different behavior for hiding and overriding. In hiding it will call base class method while in case of overriding it will call child class method.

Friday, May 20, 2011

Interview Questions N- 11

1) Difference between Truncate and Delete.

2) Difference between obj1.equal(obj2) and obj1==obj2

3) Webservice is stateless or stateful?

4) How can we maintain state in webservice?

5) Difference between function and procedure

6) Difference between abstract and interface.

7) Can we declare public variables in interface?
Ans: No, access specifier not allowed in interface. Although only function are allowed in interface not variable.

8)What is virtual function?

9) Which type of VB.Net is equalent to Variant of VB?
Ans : Object

10) Which method is equalant to C# destructor in VB .Net?
Ans : Finalizers

11) Which type of exception a web service can throw?
Ans : Fault Exception

12) Range Validator Support which type?
Ans :

13) What will be the effect of ApplydefaultSort=true in a dataset?
Ans : If true, the DataView sets a sort order to ascend based on the primary key column of the underlying DataTable. If set to false, this property has no effect. The ApplyDefaultSort property is ignored if the DataView.Sort property isn’t a null reference or an empty string. ApplyDefaultSort also has no effect if the underlying DataTable doesn’t have a primary key defined.

14) Which method used for determine dataset changes?
Ans : HasChanges()

15) Integer datatype represent which one
a) Int32 b) Int64 c) Int16
Ans : Int32

16) How will you use switches in webservice?

17) How will you trace a page in web application?

18) How will you implement roll based security in ASP .Net

19) What is boxing?
a) Encapsulate a value into object
b) Encapsulate a copy of value into object

Ans : Boxing is the process of converting a value type to the type object

20) What is difference between Byval and ByRef.

21) What is scope identity?
Ans : Give the last identity used in a function or procedure.

22) Write a query to get highest salary from employee table.

Ans : Select Top 1 Salary from Employee.

23) What is dll hell problem?
Most beautiful answer of this question was : Ma'am I have searched a lot on google but did not find any answer.

And that guy was selected.

24) How will you get any value from resource file?
Ans :
ResourceManager.GetString or ResourceManager.GetStream, depending on the type of the resource

string resourceFile = file;

string filePath = System.AppDomain.CurrentDomain.BaseDirectory.ToString();

ResourceManager resourceManager = ResourceManager.CreateFileBasedResourceManager(resourceFile, filePath, null);
// retrieve the value of the specified key
resourceValue = resourceManager.GetString(key);

Another way is using namespace


i.e.: TestProject1.Properties.Resources.MyXmlFile -> direct access to the File in the resources

25) When you deploy an ASP .Net application which files copy on production server?
Ans : Deploying an ASP.NET web application entails copying the ASP.NET-related files from the development environment to the production environment. The ASP.NET-related files include ASP.NET web page markup and code and client- and server-side support files. Client-side support files are those files referenced by your web pages and sent directly to the browser - images, CSS files and JavaScript files, for example. Server-side support files include those that are used to process a request on the server-side. This includes configuration files, web services, class files, Typed DataSets, and LINQ to SQL files, among others.

In general, all client-side support files should be copied from the development environment to the production environment, but what server-side support files get copied depends on whether you are explicitly compiling the server-side code into an assembly (a .dll file) or if you are having these assemblies auto-generated.

26) What is the type of web config file?
a) Dll b) Xml c) Resource
Ans : Xml

27) What is the use of @ when you use it before string value?
Ans: Used as escape character for backslash

28) Why we use Monitor object?
Ans : Monitor object are used to ensure that a block of code runs without interruption of other thread. This is a way of synchronization, code from other thread can not run until code written in synch block has finished.

29) Can we update ,delete or insert in a function?
Ans : Can write but such a function can not called will throw error.

30)Can we perform Select in function?
Ans : Yes

31) How can we overload methods in web service?
Ans: Using Message Name attribute

32) What is the use of MessageName, Duration in web service?
Ans : used for overloading

33) How can we override methods in web service?

Friday, May 13, 2011

Interview Questions NGR- 10

1) What is ManualReset event?
Ans : They are used to signal and non signal the waiting thread.

2) What is the use of dispose method?

3) What is connection pooling?

4) What is dipatcher?

5) Join Difference between eque join and self join?

6) Can we write return statement inside finally?
Ans : No

7) What is the use of background worker component?

8) What is Garbage Collection?

9) What us gen0, gen1, gen2?

10) Can we have destructor in C#?
Ans : Yes
11) All questions from Threading and Garbage Collection

12) If we have same method in two interfaces and we implement the same with them than how will you define that method in the class and how you will call that method?

13)If we written return statement in catch block will control go in finally ?

14) Where we use bubbling give me real scenario?
Ans : Gmail

Friday, May 6, 2011

Interview Questions Inoday - 9

1) What is job scheduling?

2) Why we use view state?

3) What is the difference between two textboxes if one has multiline true and other has false. And max length for both is 10?

4) Can we move view state tag from above to below of the page on Render event to help in SEO?

5) What is the difference between Arraylist and Arrays?

6) What is assembly?

7) What is dll?