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 :
Currency
Date
Double
Integer
String


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
Ex

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

Namespace.Properties.Resources.FileName

Ex.
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?

No comments:

Followers

Link