Sie sind auf Seite 1von 32

.

Net Interview Questions

Diversities
1. Whats the Diversities between Response.Write () and Response.Output.Write ()? Answer: Response.Outout.Write allows us to write the formatted out put. What is the Diversities between an abstract method & virtual method? Answer: An Abstract method does not provide an implementation and forces overriding to the deriving class (unless the deriving class also an abstract class ! where as the virtual method has an implementation and leaves an option to override it in the deriving class. "hus #irtual method has an implementation $ provides the derived class with the option of overriding it. Abstract method does not provide an implementation $ forces the derived class to override the method. What are the Diversities between Structure and Class? Answer: &tructures are value t'pe and (lasses are reference t'pe. &tructures can not have contractors or destructors. (lasses can have both contractors and destructors. &tructures do not support )nheritance! while (lasses support )nheritance. What are the Diversities between const and readonl ? Answer: A const can not be static! while readonl' can be static. A const need to be declared and initiali+ed at declaration onl'! while a readonl' can be initiali+ed at declaration or b' the code in the constructor. A const,s value is evaluated at design time! while a readonl',s value is evaluated at runtime. Diversitiess between dataset.clone and dataset.cop Answer: dataset.clone copies .ust the structure of dataset (including all the datatables! schemas! relations and constraints. / however it doesn,t cop' the data. On the other hand dataset.cop'! copies both the dataset structure and the data. What is Diversities between !amespace and "ssembl ? Answer: 1amespace is a logical design2time naming convenience! whereas an assembl' establishes the name scope for t'pes at run time. What is the Diversities between earl bindin# and late bindin#? Answer: (alling a non2virtual method! decided at a compile time is 4nown as earl' binding. (alling a virtual method (5ure 5ol'morphism ! decided at a runtime is 4nown as late binding.

2.

%.

*.

-.

0. 3.

&imple 6uestions
1. What is (7R8 Answer: (7R also 4nown as (ommon 7anguage Run time provides a environment in which program are e9ecuted! it activate ob.ect! perform securit' chec4 on them! la' them out in the memor'! e9ecute them and garbage collect them. What is (7&8 Answer: (7& also 4nown as (ommon 7anguage &pecification defines the rules which all language must support! in order to be a part of .1et framewor4. "he (ommon 7anguage &pecification is a set of constructs and constraints that serves as a guide for librar' writers and compiler writers. )t allows libraries to be full' usable from an' language supporting the (7&! and for those languages to integrate with each other. "he (ommon 7anguage &pecification is a subset of the common t'pe s'stem. "he (ommon 7anguage &pecification is also important to application developers who are writing code that will be used b' other developers. Which class does the web page belong to in A&5.1et8 Answer: &'stem.Web.:).5age

2.

%.

Ratnabhumi

Page 1 of 32

ashok@Ratnabhumi.com

.Net Interview Questions *. Which class deals wit the user,s locale information8 Answer: &'stem.Web.:).5age.(ulture -. What is #iew&tate8 Answer: #iew&tate is a .1et mechanism to store the posted data among post bac4s. #iew&tate allows the state of ob.ects to be stored in a hidden field on the page! saved on client side and transported bac4 to server whenever re;uired. )tems stored in a #iew&tate e9ist for the life of the current page! including the post bac4s on the same page. 0. What are the t'pes of comment in (<8 Answer: "here are % t'pes of comments in (<. &ingle line (== ! >ulti line (=? ?= and 5age=@>7 (omments (=== . 3. What is a Aash"able8 Answer: "he Aashtable ob.ect contains items in 4e'=value pairs. "he 4e's are used as inde9es! and ver' ;uic4 searches can be made for values b' searching through their 4e's. B. What is &orted7ist8 Answer: "he &orted7ist ob.ect contains items in 4e'=value pairs. A &orted7ist ob.ect automaticall' sorts items in alphabetic or numeric order. C. What is a 7iteral (ontrol8 Answer: "he 7iteral control is used to displa' te9t on a page. "he te9t is programmable. "his control does not let 'ou appl' st'les to its contentD 1E. What are the different t'pes of (aching8 Answer: "here are three t'pes of (aching: Output (aching: stores the responses from an asp.net page. Fragment (aching: Onl' caches=stores the portion of page (:ser (ontrol Data (aching: is 5rogrammatic wa' to (ache ob.ects for performance. 11. Aow to >anage &tate in A&5.1et8 "here are several wa's to manage a state. #iew&tate 6uer'&tring (oo4ies &ession Application What,s the Diversities between (odebehindGH>'(ode.asp9.csH and &rcGH>'(ode.asp9.csH8 Answer: #isual &tudio uses the (odebehind attribute to distinguish the page source or programming logic from the design. Also the src attribute will ma4e the page compile on ever' re;uest. "hat is the page will not be compiled in advance and stored in the bin as a dll instead it will be compiled at run time. &uppose 'ou want a certain A&5.1I" function e9ecuted on >ouseOver over a certain button or te9tbo9. Where do 'ou add an event handler8 Answer: Iver' web control has an abilit' to add the attributes on client side which will e9ecute on client side and run a client side script li4e a .avascript function. btn&ubmit.Attributes.Add(Jon>ouseOverK!Ksome(lient(ode( /K ==For on mouse over of a button "e9tLo91.Attributes.Add(JonFocusK!J(lear"e9t( /K ==For on focus of a te9t bo9 I9plain what a diffgram is and a good use for one8 Answer: "he DiffMram is one of the two @>7 formats that 'ou can use to render Data&et ob.ect contents to @>7. For reading database data to an @>7 file to be sent to a Web &ervice. 1ame two properties common in ever' validation control8 Answer: (ontrol"o#alidate and "e9t propert'.

"ric4' 6uestions
1.

2.

%.

*.

Ratnabhumi

Page 2 of 32

ashok@Ratnabhumi.com

.Net Interview Questions -. 0. :sing which validator 'ou can chec4 if 5assword and (onfirm 5assword are matching8 Answer: (ompare#alidator (ontrol What are the assembl' entr' points8 An Assembl' can have how man' entr' points at a time8 Answer: An assembl' can have onl' one entr' point from Dll>ain! Win>ain or >ain. What does an assembl' contain8 Answer: N >anifest 2 "he metadata describing the information below. N Assembl' name 2 Aids in versioning and visibilit' scope. N #ersion information 2 "he version number is integrated into the assembl'Os identit'. N "'pes 2 Loundaries and scopes of methods! classes! properties! events and attributes. N 7ocale 2 )nformation describing language=culture. N (r'ptographic Aash 2 5ublic 4e' encoded hash acting as version=securit' chec4. N &ecurit' 5ermissions 2 "he permissions within the assembl' determine the permissions that can be granted for all aspects of the assembl' contents. Aow man' catch statements can be associated with single tr' statement8 Answer: "here can be a +ero or more catch statement for each tr' statement. &o it has not limit to the number of catch statement per tr' statement. Which namespaces are used for data access8 &'stem.Data &'stem.Data.OleDL &'stem.Data.&67(lient What do 'ou mean b' bo9ing and un2bo9ing8 Answer: (< provides us with #alue t'pes and Reference "'pes. #alue "'pes are stored on the stac4 and Reference t'pes are stored on the heap. "he conversion of value t'pe to reference t'pe is 4nown as bo9ing and converting reference t'pe bac4 to the value t'pe is 4nown as un2bo9ing. e.g. int 9 G 1E/ ob.ect o G 9 / == )mplicit bo9ing ob.ect o G (ob.ect 9/ == I9plicit Lo9ing 9 G o/ == )mplicit :n2Lo9ing 9 G (int o/ == I9plicit :n2Lo9ing What are the different methods available under s;lcommand class to access the data8 I9ecuteReader P :sed where one or more records are returned P &I7I(" 6uer'. I9ecute1on6uer' P :sed where it affects a state of the table and no data is being ;ueried 2 )1&IR"! :5DA"I! DI7I"I! (RIA"I and &I" ;ueries. I9ecute&calar P :sed where it returns a single record(a single value normall' P &67 Functions li4e >)1( ! 1A@( What is sealed class8 What are its features8 Answer: &ealed classes are those classes which can not be inherited and thus an' sealed class member can not be derived in an' other class. A sealed class cannot also be an abstract class. )n (< structs are implicitl' sealed/ therefore! the' cannot be inherited. Wh' main function is static8 Answer: "o ensure there is onl' one entr' point to the application. What is concurrenc'8 Aow will 'ou avoid concurrenc' when dealing with dataset8 (One user deleted one row after that another user through his dataset was tr'ing to

3.

B. C.

1E.

11.

12.

1%. 1*.

Ratnabhumi

Page 3 of 32

ashok@Ratnabhumi.com

.Net Interview Questions update same row. What will happen8 Aow will 'ou avoid this problem8 Answer: )f the row we want to update has alread' been updated b' another user! the DataAdapter throws a DL(oncurrenc'I9ception. We can use the Row propert' of this e9ception to identif' the row that caused the problem. Finall'! to ensure that 'ou alwa's have a set of fresh records inside 'our Data&et ob.ect! 'ou can select the Refresh the Data&et advanced option in order to retrieve the records each time a new database operation is performed: :se optimistic concurrenc' P adds a WAIRI condition to the )1&IR"! :5DA"I! and DI7I"I statements generated automaticall' b' the wi+ard in order to guarantee to users that the' are not going to change records that have been modified b' other users! otherwise the command will fail. (an multiple catch bloc4s be e9ecuted8 Answer: 1o! once an e9ception fall under a catch bloc4 the control will never be passed to ne9t catch bloc4 instead it will be passed to the finall' bloc4 (if an' or=and the code ne9t to the finall' bloc4. Aow do 'ou turn off coo4ies for one page in 'our site8 Answer: :se the (oo4ie.Discard 5ropert' which Mets or sets the discard flag set b' the server. When true! this propert' instructs the client application not to save the (oo4ie on the user,s hard dis4 when a session ends. What are the different modes for the sessionstates in the web.config file8 Answer: Off )ndicates that session state is not enabled. )nproc )ndicates that session state is stored locall'. &tate&erver )ndicates that session state is stored on a remote server. &67&erver )ndicates that session state is stored on the &67 &erver.

1-.

10.

13.

OO5&
1. What are the OO5& concepts8 Answer: 1 Incapsulation: )t is the mechanism that binds together code and data in manipulates! and 4eeps both safe from outside interference and misuse. )n short it isolates a particular code and data from all other codes and data. A well2defined interface controls the access to that particular code and data. 2 )nheritance: )t is the process b' which one ob.ect ac;uires the properties of another ob.ect. "his supports the hierarchical classification. Without the use of hierarchies! each ob.ect would need to define all its characteristics e9plicitl'. Aowever! b' use of inheritance! an ob.ect need onl' define those ;ualities that ma4e it uni;ue within its class. )t can inherit its general attributes from its parent. A new sub2class inherits all of the attributes of all of its ancestors. % 5ol'morphism: )t is a feature that allows one interface to be used for general class of actions. "he specific action is determined b' the e9act nature of the situation. )n general pol'morphism means Hone interface! multiple methodsH/ this means that it is possible to design a generic interface to a group of related activities. "his helps reduce comple9it' b' allowing the same interface to be used to specif' a general class of action. )t is the compilerOs .ob to select the specific action (that is! method as it applies to each situation. What is a class8 Answer: (lass is concrete representation of an entit'. )t represents a group of ob.ects! which hold similar attributes and behavior. )t provides Abstraction and Incapsulations. What is an Ob.ect8 What is Ob.ect Oriented 5rogramming8 Answer: Ob.ect represents=resembles a 5h'sical=real entit'. An ob.ect is simpl' something 'ou can give a name. Ob.ect Oriented 5rogramming is a &t'le of

2.

%.

Ratnabhumi

Page 4 of 32

ashok@Ratnabhumi.com

.Net Interview Questions programming that represents a program as a s'stem of ob.ects and enables code2 reuse. What is Incapsulation8 Incapsulation is binding of attributes and behaviors. Aiding the actual implementation and e9posing the functionalit' of an' ob.ect. Incapsulation is the first step towards OO5&! is the procedure of covering up of data and functions into a single unit (called class . )ts main aim is to protect the data from out side world. What is Abstraction8 Answer: Aiding the comple9it'. )t is a process of defining communication interface for the functionalit' and hiding rest of the things. What is Overloading8 Answer: Adding a new method with the same name in same=derived class but with different number=t'pes of parameters. )t implements 5ol'morphism. What is Overloading8 Answer: A process of creating different implementation of a method having a same name as base class! in a derived class. )t implements )nheritance. What is &hadowing8 Answer: When the method is defined as Final=sealed in base class and not override able and we need to provide different implementation for the same. "his process is 4nown as shadowing! uses shadows=new 4e'word. What is )nheritance8 Answer: )t is a process of ac;uiring attributes and behaviors from another ob.ect (normall' a class or interface . What is an Abstract class8 Answer: An abstract class is a special 4ind of class that cannot be instantiated. )t normall' contains one or more abstract methods or abstract properties. )t provides bod' to a class. What is an )nterface8 Answer: An interface has no implementation/ it onl' has the signature or in other words! .ust the definition of the methods without the bod'. What is 5ol'morphism8 Answer: >ean b' more than one form. Abilit' to provide different implementation based on different number=t'pe of parameters. What is 5ure25ol'morphism8 Answer: When a method is declared as abstract=virtual method in a base class and which is overridden in a base class. )f we create a variable of a t'pe of a base class and assign an ob.ect of a derived class to it! it will be decided at a run time! which implementation of a method is to be called. "his is 4nown as 5ure25ol'morphism or 7ate2Linding. What is a (onstructor8 Answer: A special >ethod Alwa's called whenever an instance of the class is created. What is a Destructor8 Answer: A special method called b' M(. Qust before ob.ect is being reclaimed b' M(. Aow a base class method is hidden8 Answer: Aiding a base class method b' declaring a method in derived class with 4e'word new. "his will override the base class method and old method will be suppressed. What (ommand is used to implement properties in (<8 Answer: get $ set access modifiers are used to implement properties in c<. What is method overloading8 Answer: >ethod overloading is having methods with same name but carr'ing different signature! this is useful when 'ou want a method to behave differentl' depending upon a data passed to it. (an constructors have parameters8

*.

-. 0. 3. B.

C. 1E.

11. 12. 1%.

1*. 1-. 10.

13. 1B.

1C.

Ratnabhumi

Page 5 of 32

ashok@Ratnabhumi.com

.Net Interview Questions 2E. What are &tatic Assembl' and D'namic Assembl'8 Answer: &tatic assemblies can include .1I" Framewor4 t'pes (interfaces and classes as well as resources for the assembl' (bitmaps! Q5IM files! resource files! and so forth . &tatic assemblies are stored on dis4. D'namic assemblies run directl' from memor' and are not saved to dis4 before e9ecution. 21. Describe the functionalit' of an assembl'. Answer: )t is the smallest unit that has version control. All t'pes and resources in the same assembl' are versioned as a unit and support side b' side e9ecution. Assemblies contain the metadata and other identities which allow the common language runtime to e9ecute. "he' are the boundaries providing the t'pe chec4. "he' the unit where securit' permissions are re;uested and granted. 22. What is seriali+ation8 Answer: &eriali+ation is the process of converting an ob.ect into a stream of b'tes. De2seriali+ation is the opposite process of creating an ob.ect from a stream of b'tes. &eriali+ation=De2seriali+ation is mostl' used to transport ob.ects (e.g. during remoting ! or to persist ob.ects (e.g. to a file or database . "here are two separate mechanisms provided b' the .1I" class librar' for seriali+ation 2 @ml&eriali+er and &oapFormatter and Linar'Formatter. >icrosoft uses @ml&eriali+er for Web &ervices! and uses &oapFormatter=Linar'Formatter for remoting. 2%. What is a static class8 Answer: When a class has been defined as static! it is not creatable using the new 4e'word! and it can contain onl' static members or fields. 2*. What is static member8 Answer: "he member defined as static which can be invo4ed directl' from the class level! rather than from its instance. 2-. What is static function=method8 Answer: &tatic methods need not need to create an instance of the class containing it and can be accessed directl' from class level. 20. What is static constructor8 ("his is introduced in #& 2EEAnswer: When constructors are used to set the value of a t'pe,s data at the time of construction! if we want the value of such static data is to be preserved regardless of how man' ob.ects of the t'pe are created! we have to define the constructor with static 4e'word. 23. Wh' >ain ( method is static8 Answer: "o ensure there is onl' one entr' point to the application. 2B. What is Reflection8 Answer: Reflection is the process of runtime t'pe discover'. 2C. What do 'ou mean b' &eriali+e8 Answer: "he term seriali+ation describes the process of persisting (and possibl' transferring the state of an ob.ect to a stream. %E. What is an As'nchronous delegate8 (#& 2EEAnswer: When 'ou invo4e a delegate as'nchronousl'! no new thread is created. )nstead! the (7R automaticall' assigns a free thread from a small thread pool that it maintains. "'picall'! this thread pool starts with one thread and increases to a ma9imum of about 2- free threads on a single2(5: computer. As a result! if 'ou start -E as'nchronous operations! one after the other! the first 2- will complete first. As soon as one ends! the freed thread is used to e9ecute the ne9t as'nchronous operation. %1. Aow to create events for a control8 What are custom events8 Answer: Declare a public delegate and set of events to listen from. public delegate void (arIventAandler(string msg / public event (arIventAandler About"oLlow/ public event (arIventAandler Llew:p/ %2. What,s the advantage of using &'stem."e9t.&tringLuilder over &'stem.&tring8 Answer: &tringLuilder is more efficient in the cases! where a lot of manipulation is

Ratnabhumi

Page

of 32

ashok@Ratnabhumi.com

.Net Interview Questions done to the te9t. &trings are immutable! so each time it,s being operated on! a new instance is created. (an 'ou store multiple data t'pes in &'stem.Arra'8 Answer: 1o. What,s the Diversities between the &'stem.Arra'.(op'"o( and &'stem.Arra'.(lone( 8 Answer: &'stem.Arra'.(op'"o( performs a deep cop' while &'stem.Arra'.(lone( performs a shallow cop'. Aow can 'ou sort the elements of the arra' in descending order8 Answer: First use &ort ( method to sort the arra' and then call Reverse ( method to arrange arra' elements in descending order. What,s the .1I" datat'pe that allows the retrieval of data b' a uni;ue 4e'8 Answer: A Aash"able. What,s class &orted7ist underneath8 Answer: A sorted Aash"able. Will finall' bloc4 get e9ecuted if the e9ception had not occurred8 Answer: Res. When 'ou inherit a protected class2level variable! who is it available to8 Answer: (lasses in the same namespace. Are private class2level variables inherited8 Answer: Res! but the' are not accessible! so loo4ing at it 'ou can honestl' sa' that the' are not inherited. Lut the' are. Describe the accessibilit' modifier protected internal. Answer: )t,s available to derived classes and classes within the same Assembl' (and naturall' from the base class it,s declared in . Aow,s method overriding different from overloading8 Answer: When overriding! 'ou change the method behavior for a derived class. Overloading simpl' involves having a method with the same name within the class. What does the 4e'word virtual mean in the method definition8 Answer: "he method can be over2ridden. (an 'ou declare the override method static while the original method is non2static8 Answer: 1o! 'ou can,t! the signature of the virtual method must remain the same! onl' the 4e'word virtual is changed to 4e'word override. (an 'ou override private virtual methods8 Answer: 1o! moreover! 'ou cannot access private methods in inherited classes! have to be protected in the base class to allow an' sort of access. (an 'ou prevent 'our class from being inherited and becoming a base class for some other classes8 Answer: Res! that,s what 4e'word sealed in the class definition is for. "he developer tr'ing to derive from 'our class will get a message: cannot inherit from &ealed class WhateverLase(lass1ame. )t,s the same concept as final class in Qava. (an 'ou allow class to be inherited! but prevent the method from being over2ridden8 Answer: Res! .ust leave the class public and ma4e the method sealed. When do 'ou absolutel' have to declare a class as abstract8 Answer: When at least one of the methods in the class is abstract. When the class itself is inherited from an abstract class! but not all base abstract methods have been over2ridden. (an we declare private methods inside an )nterface8 Wh' can,t 'ou specif' the accessibilit' modifier for methods inside the interface8 1o! the' all must be public. "herefore! to prevent 'ou from getting the false impression that 'ou have an' freedom of choice! 'ou are not allowed to specif' an' accessibilit'! its public b' default. What,s the Diversities between an interface and abstract class8 Answer: )n the interface all methods must be abstract/ in the abstract class some methods can be concrete. )n the interface no accessibilit' modifiers are allowed! which is o4 in abstract classes.

%%. %*.

%-. %0. %3. %B. %C. *E. *1. *2. *%. **. *-. *0.

*3. *B.

*C.

-E.

Ratnabhumi

Page ! of 32

ashok@Ratnabhumi.com

.Net Interview Questions -1. )f a base class has a bunch of overloaded constructors! and an inherited class has another bunch of overloaded constructors! can 'ou enforce a call from an inherited constructor to an arbitrar' base constructor8 Answer: Res! .ust place a colon! and then 4e'word base (parameter list to invo4e the appropriate constructor in the overloaded constructor definition inside the inherited class. -2. What,s the Diversities between &'stem.&tring and &'stem.&tringLuilder classes8 Answer: &'stem.&tring is immutable/ &'stem.&tringLuilder was designed with the purpose of having a mutable string where a variet' of operations can be performed. -%. Aow do 'ou initiate a string without escaping each bac4slash8 Answer: 5ut S sign in front of the double2;uoted string. e.g. SJ(:TDocuments and &ettingsTAdministratorT>' DocumentsK/ is e;uivalent to J(:TTDocuments and &ettingsTTAdministratorTT>' DocumentsK. -*. What are valid signatures for the >ain function8 Answer: public static void >ain( public static int >ain( public static void >ain( stringUV args public static int >ain(stringUV args --. I9plain encapsulation. Answer: "he implementation is hidden! the interface is e9posed. -0. Where all the value2t'pe variables allocated in the computer RA>8 Answer: &tac4 -3. Where do the reference2t'pe variables go in the RA>8 Answer: "he references go on the stac4! while the ob.ects themselves go on the heap. -B. What is the Diversities between the value2t'pe variables and reference2t'pe variables in terms of garbage collection8 Answer: "he value2t'pe variables are not garbage2collected! the' .ust fall off the stac4 when the' fall out of scope! the reference2t'pe ob.ects are pic4ed up b' M( when their references go null. -C. Aow do 'ou convert a string into an integer in .1I"8 Answer: )nt%2.5arse(string ! (onvert."o)nt%2( 0E. Aow do 'ou enforce garbage collection in .1I"8 Answer: &'stem.M(.(ollect( / 01. (an 'ou declare a (WW t'pe destructor in (< li4e X>'(lass( 8 Answer: Res! but what,s the point! since it will call Finali+e ( ! and Finali+e ( has no guarantees when the memor' will be cleaned up! plus! it introduces additional load on the garbage collector. "he onl' time the finali+er should be implemented! is when 'ou,re dealing with unmanaged code. 02. What,s the Diversities between const and readonl'8 Answer: Rou can initiali+e readonl' variables to some runtime values. 7et,s sa' 'our program uses current date and time as one of the values that won,t change. "his wa' 'ou declare public readonl' string Date" G new Date"ime( ."o&tring( / "his is not possible with a constant. 0%. What happens when 'ou encounter a continue statement inside the Yfor loop,8 Answer: "he code for the rest of the loop is ignored/ the control is transferred bac4 to the beginning of the loop. 0*. Describe the compilation process for .1I" code8 Answer: &ource code is compiled and run in the .1I" Framewor4 using a two2stage process. First! source code is compiled to >icrosoft intermediate language (>&)7 code using a .1I" Framewor42compatible compiler! such as that for #isual Lasic .1I" or #isual (<. &econd! >&)7 code is compiled to native code. 0-. )n which cases 'ou use override and new base8 Answer: :se the new modifier to e9plicitl' hide a member inherited from a base

Ratnabhumi

Page " of 32

ashok@Ratnabhumi.com

.Net Interview Questions class. "o hide an inherited member! declare it in the derived class using the same name! and modif' it with the new modifier. )n which &cenario 'ou will go for )nterface or Abstract (lass8 Answer: )nterfaces! li4e classes! define a set of properties! methods! and events. Lut unli4e classes! interfaces do not provide implementation. "he' are implemented b' classes! and defined as separate entities from classes. Iven though class inheritance allows 'our classes to inherit implementation from a base class! it also forces 'ou to ma4e most of 'our design decisions when the class is first published. Abstract classes are useful when creating components because the' allow 'ou specif' an invariant level of functionalit' in some methods! but leave the implementation of other methods until a specific implementation of that class is needed. "he' also version well! because if additional functionalit' is needed in derived classes! it can be added to the base class without brea4ing code. What are the access2specifiers available in c<8 Answer: 5rivate! 5rotected! 5ublic! )nternal! 5rotected )nternal. I9plain about 5rotected and protected internal! JinternalK access2specifier8 Answer: protected 2 Access is limited to the containing class or t'pes derived from the containing class. internal 2 Access is limited to the current assembl'. protected internal 2 Access is limited to the current assembl' or t'pes derived from the containing class. Diversities between t'pe constructor and instance constructor8 What is static constructor! when it will be fired8 And what is its use8 Answer: ((lass constructor method is also 4nown as t'pe constructor or t'pe initiali+er )nstance constructor is e9ecuted when a new instance of t'pe is created and the class constructor is e9ecuted after the t'pe is loaded and before an' one of the t'pe members is accessed. ()t will get e9ecuted onl' 1st time! when we call an' static methods=fields in the same class. (lass constructors are used for static field initiali+ation. Onl' one class constructor per t'pe is permitted! and it cannot use the vararg (variable argument calling convention. A static constructor is used to initiali+e a class. )t is called automaticall' to initiali+e the class before the first instance is created or an' static members are referenced. What is 5rivate (onstructor8 What,s its use8 (an 'ou create instance of a class which has 5rivate (onstructor8 Answer: When a class declares onl' private instance constructors! it is not possible for classes outside the program to derive from the class or to directl' create instances of it. (I9cept 1ested classes >a4e a constructor private if: 2 Rou want it to be available onl' to the class itself. For e9ample! 'ou might have a special constructor used onl' in the implementation of 'our classO (lone method. 2 Rou do not want instances of 'our component to be created. For e9ample! 'ou ma' have a class containing nothing but &hared utilit' functions! and no instance data. (reating instances of the class would waste memor'. ) have % overloaded constructors in m' class. )n order to avoid ma4ing instance of the class do ) need to ma4e all constructors to private8 Answer: Res Overloaded constructor will call default constructor internall'8 Answer: 1o

00.

03. 0B.

0C.

3E.

31. 32.

&67: 6ueries
1. Write a ;uer' to select the second highest salar' from a table. Answer: &I7I(" ma9(salar' A& salar'2 FRO> orders WAIRI salar' Z (&I7I(" ma9(salar' A& salar'1 FRO> orders

Ratnabhumi

Page # of 32

ashok@Ratnabhumi.com

.Net Interview Questions 2. %. *. Write a ;uer' to select the -th highest salar' from a table. Answer: &I7I(" min(salar' A& high- FRO> emplo'ee WAIRI salar' )1(&I7I(" D)&")1(" "O5 - salar' FRO> orders ORDIR LR salar' DI&( Aow to find duplicate records with the number the' are duplicated8 Answer: &I7I(" )d! count (? as number[records from table group b' id having count (? \ 1. :sing ;uer' anal'+er! name % wa's 'ou can get an accurate count of the number of records in a table. Answer: a. select count (coumn1ame(s from table1ame. b. select count[big(coumn1ame(s from table1ame c. select column1ame from able1ame select SSROW(O:1" as row(ount

&67: 6uestions
1. What is the Diversities between Delete and "runcate command in &678 Answer: Delete command and truncate command both will delete the data! however the truncate command can not be rolled bac4 as delete can be. "he delete command can be used for selected records using the where clause but with the truncate command we have to loose data. DI7I"I statement is a logged operation and hence ta4es more time then truncate. What is >agic "able in &678 Answer: "he insert and Delete commands are 4nown as magic tables in &67. (an 5rimar' 4e' is a Foreign ]e' on the same table8 Answer: Res! (onsider a categor' table in a e2commerce web site. (ategor'[)d! (ategor'[1ame! 5arent[(ategor'[)D. )n this table all the parent categories are also categories. When we create a self .oin categor' id will be treated as foreign 4e' to the same table. What is 1ormali+ation8 What are the advantages and disadvantages of 1ormali+ation8 Answer: "here are several advantages of normali+ation as under: Faster sorting and inde9 creation. A larger number of clustered inde9es. 1arrower and more compact inde9es. Fewer inde9es per table! which improves the performance of )1&IR"! :5DA"I! and DI7I"I statements Fewer null values and less opportunit' for inconsistenc'! which increase database compactness. Leside the above benefits there are few disadvantages as well: )ncreased amount of 1ormali+ation increases the amount of comple9it' of .oins between tables and that hinders the performance. What are the conditions to achieve the normali+ation8 Answer: "here are few conditions to achieve the normali+ation: "here should be a uni;ue row identifier. A table should store onl' data for a single t'pe of entit'. For e.g. details for boo4,s publisher and boo4,s author should be saved under different table. A table should avoid columns which can be null2able. A table should avoid duplication of data and columns. What is a &tored 5rocedure8 &tate its advantage. Answer: A stored procedure is a set of pre2compiled &67 commands (;uer' statements ! which are stored in the server. )t is faster then the loose &67 statements

2. %.

*. -.

0.

3.

Ratnabhumi

Page 1$ of 32

ashok@Ratnabhumi.com

.Net Interview Questions processed on client! as it is pre2compiled. )t can e9ecute more then one &67 commands once as the' are bundled in a single entit'. We can use control statements within the stored procedure! which will allow us to repeat some &67 command. )t can send return values depending upon the result. &tored procedures are used to reduce networ4 traffic. What is a "rigger8 Answer: "riggers are a special t'pe of stored procedure! which gets invo4ed upon a certain event. "he' can be performed upon an )1&IR"! :5DA"I and DI7I"I. What is a (lustered )nde98 Answer: "he data rows are stored in order based on the clustered inde9 4e'. Data stored is in a se;uence of the inde9. )n a clustered inde9! the ph'sical order of the rows in the table is the same as the logical (inde9ed order of the 4e' values. A table can contain onl' one clustered inde9. A clustered inde9 usuall' provides faster access to data than does a non2clustered inde9 What is a 1on2(lustered )nde98 Answer: "he data rows are not stored in an' particular order! and there is no particular order to the se;uence of the data pages. )n a clustered inde9! the ph'sical order of the rows in the table is not same as the logical (inde9ed order of the 4e' values. Describe the three levels of data abstraction8 "he are three levels of abstraction: 5h'sical level: "he lowest level of abstraction describes how data are stored. 7ogical level: "he ne9t higher level of abstraction! describes what data are stored in database and what relationship among those data. #iew level: "he highest level of abstraction describes onl' part of entire database What is DD7 (Data Definition 7anguage 8 Answer: A data base schema which is specified b' a set of definitions e9pressed b' a special language is called DD7. Data Definition 7anguage (DD7 is used to define and manage all the ob.ects in an &67 database. What is D>78 Answer: )t is a special language used to manipulate the Data. Data >anipulation 7anguage (D>7 ! which is used to select! insert! update! and delete data in the ob.ects defined using DD7. What is a 5R)>ARR ]IR8 Answer: "he 5R)>ARR ]IR is the column(s used to uni;uel' identif' each row of a table. What is a FORI)M1 ]IR8 Answer: A FORI)M1 ]IR is one or more columns whose values are based on the 5R)>ARR or (A1D)"A"I ]IR values from the database. What is a :1)6:I ]IR8 Answer: A :1)6:I ]IR is one or more columns that must be uni;ue for each row of the table. What is the Diversities between :1)6:I and 5R)>ARR ]IR8 Answer: "he :1)6:I ]IR column restricts entr' of duplicate values but entr' of 1:77 value is allowed. )n case of 5R)>ARR ]IR columns entr' of duplicate as well as Z1:77\ value is also restricted. What is a #)IW8 Answer: A #iew is a database ob.ect that is a logical representation of a table. )t is derived from a table but has no storage space of its own and often ma' be used in the same manner as a table. What is a ROW)D8 Answer: ROW)D is the logical address of a row! and it is uni;ue within the database.

B. C.

1E.

11.

12.

1%.

1*. 1-. 10. 13.

1B.

1C.

Ratnabhumi

Page 11 of 32

ashok@Ratnabhumi.com

.Net Interview Questions 2E. What is )1DI@8 Answer: )1DI@ is a general term for an &67 feature used primaril' to speed up e9ecution and impose :1)6:I1I&& upon data. Rou can use an inde9 to gain fast access to specific information in a database table. An inde9 is a structure that orders the values of one or more columns in a database table. "he inde9 provides pointers to the data values stored in specified columns of the table! and then orders those pointers according to the sort order 'ou specif'. 21. What is a cursor8 Answer: An entit' that maps over a result set and establishes a position on a single row within the result set. After the cursor is positioned on a row! operations can be performed on that row! or on a bloc4 of rows starting at that position. "he most common operation is to fetch (retrieve the current row or bloc4 of rows. 22. "he Diversities between O(ountO and O(ount (? O8 Answer: O(ountO: (ounts the number of non2null values. O(ount (? O: (ounts the number of rows in the table! including null values and duplicates. 2%. Which are the default databases get installed with the >&&67 installation8 Answer: >aster! >odel! msdb! 1orthwind! 5ubs! tempdb. 2*. What is the purpose of using (O77A"I in a ;uer'8 2-. What is the &":FF function and how does it differ from the RI57A(I function8 Answer: &":FF deletes a specified length of characters and inserts another set of characters at a specified starting point. RI57A(I removes the specified string and inserts supplied string in place. 20. What does the parameter )nitial (atalog define inside (onnection &tring8 Answer: "he database name to connect to. 23. What,s the data provider name to connect to Access database8 Answer: >icrosoft.Access. 2B. What does Dispose ( method do with the connection ob.ect8 Answer: Deletes it from the memor'. 2C. What is a pre2re;uisite for connection pooling8 Answer: >ultiple processes must agree that the' will share the same connection! where ever' parameter is the same! including the securit' settings.

Mlossar' $ "erms
1. abstract method: A method that has no implementation/ if a class has an abstract method! then the class is abstract as well. 2. Abstraction: A process of retrieving information about an ob.ect. %. abstract class :A class that can,t be instantiated and can onl' be derived from. *. Arra': A collection of same2t'pe variables or elements identified with an inde9. -. Arra'7ist: A d'namic arra' class: a. )t has a default capacit' of 10 ob.ects. b. )t automaticall' increases in si+e. c. )t holds an' t'pe of ob.ect reference. When accessing the ob.ects! the' need to be cast to the appropriate t'pe. 0. Assembl': A repositor' (e.g.! .dll or .e9e to store multiple and related code constructs or functionalit'. 3. const: A static modifier used on local variables or member fields/ once its value is assigned! it can,t be changed at runtime. B. constructor: A special method that instantiates a class into an ob.ect. C. destructor: >ethod declaration to terminate an ob.ect^e.g.! Xa(lass( : used with Finali+e( . 1E. delegate: A class that is a reference to a method that has a given signature (parameter list and return t'pe . "his is also 4nown as functional pointer. 11. deseriali+e: A process to reconstruct from a binar' stream bac4 to a (< ob.ect. 12. dictionar': (ollection with a 4e' and value association.

Ratnabhumi

Page 12 of 32

ashok@Ratnabhumi.com

.Net Interview Questions 1%. Iarl' Linding: >ethodolog' whereb' binding is determined as design time. 1*. enum: A value t'pe that contains an enumerator list (a set of named numeric constants . Inumeration list of named constants: enum 4e'word or value t'pe that holds a ;uantit' of named numeric constants (b'te! sb'te! short! ushort! long! ulong! int! unit . 1-. e9tern: >odifies a method! indicating that unmanaged code is used to implement it. 10. Aash"able: &ame as Dictionar' that is twea4ed for speed' retrieval. 13. Menerics: >ethodologies that enable class! delegate! interface! struct t'pes! and methods to be created with t'pe parameters! which are JplaceholderK t'pes that can be substituted when the t'pe is 4nown ((< 2.E feature . 1B. Meneric method: A method that accepts t'pe parameters ((< 2.E feature . 1C. immutable: :nchangeable: a string ma' appear to change! but a method merel' returns a modified string ob.ect. (&trings are immutable! stringbuilder class is mutable. 2E. inheritance: a methodolog' in which functionalit' is inherited (class and interface t'pe . 21. .agged arra': A multidimensional arra' where the rows are of var'ing si+es: an arra' is comprised of elements that are themselves arra's. )t is also 4nown as Arra' of Arra's. 22. lin4ed list: A data structure that has a series of connected nodes. 2%. late binding: A methodolog' in which binding is determined at runtime. 2*. manifest: An assembl',s contents/ it is also referred to as assembl' metadata. 2-. multidimensional arra': An arra' with multiple dimensions (rows and columns . (< has two: .agged (UVUV and rectangular(U!V . 20. new: A 4e'word that calls a class,s constructor. 23. operator overloading: A techni;ue whereb' an operator is overloaded to give a class the functionalit' of the operator. 2B. overloading: "he abilit' to include more than one method in the same class with the same name. 2C. overriding: When a virtual method in a base class has its functionalit' superimposed or overridden b' a method in a subclass! which has the same name and signature. %E. pol'morphism: Ob.ect2oriented concept whereb' a speciali+ed class ma' be passed as an instance of a generali+ed class (class pol'morphism : also refers to methods of a class (method pol'morphism . %1. passing b' reference: Reference t'pes are passed to a calling method b' reference^a reference to a memor' location (Jthe heapK is passed rather than a cop' of the t'pe (contrast passing b' value . %2. passing b' value: #alue t'pes are passed to a calling method b' wa' of a cop' of the underl'ing value t'pe^altering the cop' does not alter the underl'ing (original value t'pe. 5assing b' value occurs on the stac4 (contrast with passing b' reference . %%. readonl': ]e'word used to declare that a class member variable is read2onl' and can,t be edited at runtime. %*. Rectangular arra': A form of multidimensional arra' with two or more dimensions that has rows of the same length (contrast with .agged arra' . %-. sealed: A modifier that signifies that a given concrete class cannot be derived from or inherited. %0. shallow cop': A techni;ue that copies an ob.ect variable into another variable b' value rather than b' reference. %3. strong name: A uni;ue composite of assembl' name! assembl' version! and encr'ption 4e'. %B. t'ped dataset: Dataset associated with a defined @>7 schema: faster and more efficient than unt'ped dataset because the schema is defined and does not re;uire runtime t'pe identification when run. %C. value t'pe: Data that is stored in a variable: value t'pes are stored with their contents on the stac4. (onsists of structures! primitives! and enumerations.

Ratnabhumi

Page 13 of 32

ashok@Ratnabhumi.com

.Net Interview Questions

Write (ode For


1. Write a program in (< to find the angle between the hours and minutes in a cloc48

"esting 6uestions
1. What debugging tools come with the .1I" &D]8 1. (orDLM P command2line debugger. "o use (orDbg! 'ou must compile the original (< file using the =debug switch. 2. Dbg(7R P graphic debugger. #isual &tudio .1I" uses the Dbg(7R. What does assert ( method do8 )n debug compilation! assert ta4es in a Loolean condition as a parameter! and shows the error dialog if the condition is false. "he program proceeds without an' interruption if the condition is true. What,s the Diversities between the Debug class and "race class8 Documentation loo4s the same. :se Debug class for debug builds! use "race class for both debug and release builds. Wh' are there five tracing levels in &'stem.Diagnostics."race&witcher8 "he tracing dumps can be ;uite verbose. For applications that are constantl' running 'ou run the ris4 of overloading the machine and the hard drive. Five levels range from 1one to #erbose! allowing 'ou to fine2tune the tracing activities. Where is the output of "e9tWriter"race7istener redirected8 "o the (onsole or a te9t file depending on the parameter passed to the constructor. Aow do 'ou debug an A&5.1I" Web application8 Attach the aspnet[wp.e9e process to the Dbg(lr debugger. What are three test cases 'ou should go through in unit testing8 1. 5ositive test cases (correct data! correct output . 2. 1egative test cases (bro4en or missing data! proper handling . %. I9ception test cases (e9ceptions are thrown and caught properl' . (an 'ou change the value of a variable while debugging a (< application8 Res. )f 'ou are debugging via #isual &tudio.1I"! .ust go to J)mmediate windowK.

2.

%.

*.

-. 0. 3.

B.

Lasic Design 5attern 6uestions

1. I9plain the three services model (three2tier application . Answer: 5resentation (:) ! business (logic and underl'ing code and data (from storage or other sources . 2. I9plain A()D rule of thumb for transactions. Answer: "ransaction must be _ Atomic (it is one unit of wor4 and does not dependent on previous and following transactions ! (onsistent (data is either committed or roll bac4! no Jin2betweenK case where something has been updated and something hasn,t ! )solated (no transaction sees the intermediate results of the current transaction ! Durable (the values persist if the data had been committed even if the s'stem crashes right after .

6uestions with answer options


&tate "rue or False: )f 'ou set AutoMenerate(olumnsG"rue and still provide custom column definitions! the DataMrid will render both o "rue o False "he data from an @&7 "ransform with @mlReader can be returned in one of the following wa's

Ratnabhumi

Page 14 of 32

ashok@Ratnabhumi.com

.Net Interview Questions o ob.Reader G ob.@sl"."ransform(ob.1av! nothing o ob.@sl"."ransform(ob.1av! nothing o ob.Reader G ob.@sl"."ransform(ob.1av! nothing! ob.Writer o ob.@sl"."ransform(ob.1av! nothing! ob.Writer 5ic4 the command line that would result in the (< compiler generating an @>7 documentation file o csc =doc:1ewAome.9ml 1ewAome.cs o c =doc =docfile: 1ewAome.9ml 1ewAome.cs o csc =doc =out: 1ewAome.9ml 1ewAome.cs o csc =9ml 1ewAome.cs What is the comment s'nta9 for (<,s @>72based documentation8 o =?? and ??= o ==< o === o ==? When creating a (< (lass 7ibrar' pro.ect! what is the name of the supplementar' file that #isual &tudio.1I" creates that contains Meneral )nformation about the assembl'8 o Assembl')nfo.9ml o Assembl')nfo.cs o Assembl')nformation.cs o Assembl'Attributes.cs Which of the following is the (< escape character for 1ull8 o Tn o TE o Tf o Tv What is the e9ception that is thrown when there is an attempt to d'namicall' access a method that does not e9ist8 o >issing>ethodI9ception o "'pe7oadI9ception o >ethod7oadI9ception o >ethodAccessI9ception What method(s must be used with the Application ob.ect to ensure that onl' one process accesses a variable at a time8 o &'nchroni+e( o 7oc4( and :n7oc4( o 7oc4( o As'nchroi+e( After capturing the &elected)nde9(hanged event for a 7istLo9 control! 'ou find that the event handler doesn,t e9ecute. What could the problem be8 o "he AutoIventWireup attribute is set to False o "he Automatic5ostLac4 attribute is set to False o "he codebehind module is not properl' compiled o "he 7istLo9 must be defined WithIvents What method must be overridden in a custom control8 o "he 5aint( method o "he (ontrol[Luild( method o "he Render( method o "he default constructor What is used to validate comple9 string patterns li4e an e2mail address8 o I9tended e9pressions

Ratnabhumi

Page 15 of 32

ashok@Ratnabhumi.com

.Net Interview Questions o Regular e9pressions o )rregular e9pressions o Lasic e9pressions "he following is a valid statement in A&5.1I"Z`S 5age 7anguageGH(H `\ o "rue o False A valid comment bloc4 in A&5.1I" is o ZD2 2 2 (omment 2 2 2 \ o ZD2 2 (omment 2 2 \ o Z` 2 2 (omment 2 2 `\ o Z` D 2 2 (omment 2 2 \ "he event handlers that can be included in the Mlobal.asa9 file are o Application &tart and Session &tart event handlers onl' o Application Ind and Session Ind event handlers onl' o 5er2re;uest and 1on2deterministic event handlers onl' o Application &tart and Ind ! Session &tart and Ind! 5er2re;uest and 1on2deterministic event handlers A Few of the 1amespaces that get imported b' default in an A&5@ file are o &'stem! &'stem.Data! &'stem.Drawing! &'stem.Mlobali+ation o &'stem! &'stem.)O! &'stem.>anagement! &'stem.Mlobali+ation o &'stem! &'stem.(ollections! &'stem."e9t! &'stem.Web o &'stem! &'stem.1I"! &'stem.Reflection! &'stem.Web "he Assemblies that can be referenced in an A&5@ file without using SAssembl' Directive is o &'stem.dll! &'stem.Data.dll! &'stem.Web.dll! &'stem.@ml.dll! o &'stem.dll! &'stem.(ollections.dll! &'stem.)O.dll o &'stem.dll! &'stem.Reflection.dll! &'stem.Mlobali+ation.dll! o &'stem.Drawing.dll! &'stem.Assembl'.dll! &'stem."e9t.dll An .A&A@ file contains the following o (ode2behind that are used in the code o &erver (ontrols that can be called from a code2behind file o A""5 handlers2software modules that handle raw A""5 re;uests received b' A&5.1I" o (ontains normal A&5.1I" code and can be used as an include file What is the output for the following code snippet: public class test(lass a public static void >ain(stringUV args a &'stem.(onsole.Write7ine(argsU1V /

Ratnabhumi

Page 1 of 32

ashok@Ratnabhumi.com

.Net Interview Questions b==end >ain b==end class test(lass o (ompiler Irror o Runtime Irror o Aello (< world o 1one of the above What will be the values of 9 and '8 a int 9 G -/ int ' G 1E/ ' WG 9WW/ &'stem.(onsole.Write7ine(H9:H W 9.to&tring( W H ':H W '.to&tring( / b o 9: 0 ': 10 o 9: 0 ': 1o 9: 1E ': 1o 9: 1E ': 20 One of the possible wa' of writing an A&5.1I" handler that wor4s li4e an )&A5) filter2 that is! that sees re;uests and responses and modifies them also! is b'! o writing a module that e9tends FormsAuthenticaton>odule and using it o writing a component class that e9tends Attp>odule(ollection and using it o writing an A""5 module2a (lass that implements )http>odule and registering it in Web.(onfig o All of the above "he A&5.1I" directive that lets 'ou cache different versions of a page based on var'ing input parameters! A""5 headers and browser t'pe is o SOutput(ache o S(acheOutput o S5age(ache o S(acheAll )f we develop an application that must accommodate multiple securit' levels through secure login and A&5.1I" web application is spanned across three web2servers (using round2robin load balancing what would be the best approach to maintain login2in state for the users8 o ZSession&tate modeGH)n5rocHstate(onnection&tringGH tcpipG123.E.E.1:*2*2*H s;l(onnection&tringGH data sourceG123.E.E.1/user idGsa/passwordGHcoo4ielessGHfalseH timeoutGH%EH =\ o ZSession&tate modeGHOut5rocH state(onnection&tringGHtcpipG123.E.E.1:*2*2*H s;l(onnection&tringGHdata sourceG123.E.E.1/user idGsa/passwordGH coo4ielessGHfalseH timeoutGH%EH =\ o ZSession&tate modeGHstateserverH state(onnection&tringGHtcpipG123.E.E.1:*2*2*H s;l(onnection&tringGHdata sourceG123.E.E.1/user idGsa/passwordGH coo4ielessGHfalseH timeoutGH%EH =\ What is the output for the below mentioned compilation command\ csc =addmodule:A.I9e L.(s o A.e9e o L.e9e o A.dll o L.dll Aow can be the web application get configured with the following authori+ation rules o Anon'mous users must not be allowed to access the application.

Ratnabhumi

Page 1! of 32

ashok@Ratnabhumi.com

.Net Interview Questions All persons e9cept David and Qohn must be allowed to access the application. Zauthori+ation\Zden' users G HapplicationnameTDavid! applicationnameTQohnH \Zallow roles GH?H\Zden' roles G H8H\Z=authori+ation\ Zauthori+ation\Zallow users GH?H\Zden' users G HapplicationnameTDavid/ applicationnameTQohnH \Zden' users G H?H\Z=authori+ation\ Zauthori+ation\Zden' users G HapplicationnameTDavid! applicationnameTQohnH \Zden' users G H8H\Zallow users GH?H\Z=authori+ation\ Zauthori+ation\Zallow users GH?H\Zden' users G HapplicationnameTDavid! applicationnameTQohnH \Z=authori+ation\ What will be the output of the following code snippet8 o using &'stem/ class >ain(lass a static void >ain( a new >ain(lass( .Displa'( %.-0 / b private void Displa'( float anArg a (onsole.Write( JaEb a1bK! anArg.Met"'pe( ! anArg / b double Displa'( double anArg a (onsole.Write( JaEb a1bK! anArg.Met"'pe( ! anArg / return anArg/ b public decimal Displa'( decimal anArg a (onsole.Write( JaEb a1bK! anArg.Met"'pe( ! anArg / return anArg/ b b o o o o &'stem.&ingle %.-0 &'stem.Float %.-0 &'stem.Double %.-0 &'stem.Decimal %.-0

What will be output for the given code8 Dim ) as integer G Do )G)W2 Response.Write () $ H H 7oop :ntil ) \ 1E o -B o -3C

Ratnabhumi

Page 1" of 32

ashok@Ratnabhumi.com

.Net Interview Questions o 3 C 11 o Irrors out A structure in (< can be derived from one or more o class o interface o both o none &tate "rue or False: &tatic method cannot be overridden o "rue o False "he I;uivalent A">7 (ontrol for the Zinput t'peGKbuttonK\ tag is o Atml)nput o AtmlLutton o Atml5ushLutton o Atml)nputLutton "he I;uivalent Atml (ontrol for the Zinput t'peGKchec4bo9K\ tag is o Atml(hec4Lo9 o Atml)nput(h4Lo9 o Atml)nput(hec4Lo9 o Atml)nput"'pe(h4Lo9 Which operator is used for connecting a event with a procedure in (<8 o WG o G o both o none "he I;uivalent Atml (ontrol for the Zselect\ tag is o ZAtml&elect)nput\ o ZAtml&elect\ o ZAtml)nput&elect\ o ZAtml&elect(ontrol\ &tate "rue or False: Ivents in Web forms are processed before the J5age 7oadK event o "rue o False What namespaces are necessar' to create a locali+ed application8 o S stem.Mlobali+ation o S stem.Mlobali+ation and S stem.Resources. o S stem.Resources. o S stem.Arra' A new server2side control can be created b' implementing the class [[[[[[[[[[[ o S stem.Web.Web(ontrol o S stem.Web.:).Web(ontrol o S stem.Web.:).Web(ontrols.Web(ontrol o An' one of the above "he parameter Jclienttarget G downlevelK does one of the following o Adds aliases for specific user agents to an internal collection of user agent aliases o )ndicates the useragents level of validating the controls o Disables all DA">7 events(including #alidation controls o 1one of the above "he methods in (< can be overloaded in which of the following wa's

Ratnabhumi

Page 1# of 32

ashok@Ratnabhumi.com

.Net Interview Questions L' having the same method name and specif'ing different number of parameters o L' giving different method names and same number of parameters o L' having the same method name and specif'ing different t'pes of parameters o L' giving different method names and same t'pes of parameters "he Range#alidator control supports the following datat'pe o )nteger and &tring o )nteger! Float! &tring! @>7Datat'pes o )nteger! &tring and Date o )nteger! Loolean! &hort! &tring and Date What is the Diversities between (onvert."o)nt%2 and int.5arse8 o Loth are same and both can handle null value. o (onvert."o)nt%2 can handle null value but int.5arse throws Argument1ullI9ception error. o int.5arse can handle null value but (onvert."o)nt%2 throws Argument1ullI9ception error. o Loth (onvert."o)nt%2 and int.5arse cannot handle null value. &tate "rue or False: An' ODL(2compliant database can be accessed through A&5.1I" o "rue o False Rou need to select a .1I" language that has auto2documenting features built into the source code and compiler. Miven the scenario above what language compiler should be selected8 o vbc.e9e o cl.e9e o ilasm.e9e o cs.e9e A set of tables are maintained in a Dataset as o "ables(ollection ob.ect o Data"able(ollection ob.ect o DataRows(ollection ob.ect o "ableRow(ollection ob.ect "he namespaces needed to use data mechanisms in A&5.1I" pages are o S stem.Data! S stem.Data.OleDb or S stem.Data.&67 o S stem.Data! S stem.Data.ODL( o S stem.Data! S stem.Data.DataRow o S stem.Data.DataRow(ollection! S stem.Data.Db"'pe What are the different methods to access Database in .1I" 8 o OleDL!ODL(!&67(lient o OleDL! QDL(! &67&erver o ODL(2QDL(! Data&et! &67(lient o Datasource! Data&et! D&1 "he two properties of a DataMrid that has to be specified to turn on sorting and paging respectivel' are o Inable&orting G JtrueK and Inable5aging G JtrueK o Disable&orting G JfalseK and Disable5aging G JfalseK o Allow&orting G JtrueK and Allow5aging G JtrueK o &orting G JtrueK and 5aging G JtrueK Which one of the following ob.ects is used to create a foreign 4e' between two Data"ables8 o

Ratnabhumi

Page 2$ of 32

ashok@Ratnabhumi.com

.Net Interview Questions o DataRelation o DataRelationship o Data(onstraint o Data]e' "he &'nta9 for data2binding e9pressions is o Z`< propert' or collection `\ o Z`< propert' or collection <`\ o Z`c propert' or collection `\ o Z`S propert' or collection `\ "he method that need to be invo4ed on the DataAdapter control to load the generated dataset with data is o Lind( o Fill( o FillData( o &etData( Which of the following operations can 'ou 1O" perform on an ADO.1I" Data&et8 o A Data&et can be s'nchronised with the database. o A Data&et can be s'nchronised with a Record&et. o A Data&et can be converted to @>7. o Rou can infer the schema from a Data&et Which is the correct statement to set the alias name for namespace in (<8 o using S stem Data.Oracle(lient G alias1ame/ o using alias1ame G S stem.Data.Oracle(lient/ o string alias1ame G using.S stem.Data.Oracle(lient/ o Loth a $ b "he propert' that indicates whether e9isting database constraints should be observed when performing updates o Inforce(onstraints o (onstraints o Met(onstraints o (onstraintsInforce Which of the following languages is 1O" included in the default .1I" Framewor4 installation8 o (< o #L.1I" o Q&cript.1I" o #L&cript.1I" What are the different t'pes of seriali+ation supported in .1I" Framewor4 o @ml&eriali+er o &oapFormatter o @5ath1avigator o AttpFormatter "he (7R uses which format for assembl' version numbers o >a.or:>inor:Revision:Luild o >a.or:Luild:>inor:Revision o >a.or:Revision:>inor:Luild o >a.or:>inor:Luild:Revision What tool is used to manage the MA(8 o Mac>gr.e9e o Mac&vr%2.e9e o Mac:til.e9e o Reg&vr.e9e

Ratnabhumi

Page 21 of 32

ashok@Ratnabhumi.com

.Net Interview Questions

Ratnabhumi

&tate "rue or False: A single .1I" dll can contain unlimited classes o "rue o False &tate "rue or False: A&5.1I" can currentl' run onl' on Windows 5latform o "rue o False Which one of the following best describes J"'pe2&afeK o )t ensures that the data t'pe are safel' handled o )t ensures that t'pes are not mismatched when the' are called so uses a t'pecasting before referencing an' data ob.ect o )t ensures that an ob.ect onl' references memor' locations that it,s allowed to! preventing data corruption and the accidental misuse of ob.ect t'pes o All of the above "he number of ob.ects in A&5.1I" is o 0 o 3 o C o 1E "he code used to turn off buffering is o Luffering G false o OutputLuffer G false o LufferOutput G false o Luffer G Off (an 'ou have two applications on the same machine one which is using .1I" Framewor4 1.1 and the other using 2.E 8 o Res o 1o o Depends on S stem configuration Which of the following DO".1I" tools manages certificates! certificate trust lists (("7s ! and certificate revocation lists ((R7s 8 o sn.e9e o certnet.e9e o certmgr.e9e o gacutil.e9e Rou need to generate a public=private 4e' pair for using in creating a shared assembl'. Miven the above scenario! which .1I" &D] utilit' should be used8 o certmgr.e9e o gacutil.e9e o sn.e9e o resgen.e9e "he ob.ect that contains all the properties and methods for ever' A&5.1I" page! that is built is o 5age Ob.ect o A""55age Ob.ect o Web5age Ob.ect o &'stem.Web.:).5age )n (<! which character is used to indicate a verbatim string literal8 o S o D o H o < Which of the following operators has the highest precedence8

Page 22 of 32

ashok@Ratnabhumi.com

.Net Interview Questions 5re )ncrement (WW9 &hift bits left: ZZ Litwise Or: d 5ost )ncrement (9WW

o o o o

"he uni;ue)d that gets generated at the start of the Session is stored in o (lient computer as a coo4ie o &erver machine o 5assed to and fro on each and ever' re;uest and response o Loth a and b are correct &tate "rue or False: (< supports multiple2inheritance o "rue o False Litwise A1D operator in (< is o $ o $$ o A1D o @A1D Litwise OR operator in (< is o OR o dd o d o @OR What,s the .1I" datat'pe that allows the retrieval of data b' a uni;ue 4e'8 o 5rimar' o )nteger o :ni;ue )dentifier o Aash"able "he 4e'word Yint, maps to one of the following .1I" t'pes o &'stem.)nt10 o &'stem.)nt%2 o &'stem.)nt0* o &'stem.)nt12B What can be achieved in )7 which is not possible in (<8 o (reation of an Arra'7ist o (reation of a Dictionar' o (reation of a two dimensional arra' o (reation of a non2+ero based arra' Which of the following is the correct code for setting a &ession timeout of %E minutes o &ession."imeout G 1EBEEE o &ession."imeout G 1BEE o &ession."imeout G %EE o &ession."imeout G %E "he process that A&5.1I" uses to 4eep trac4 of &essions without coo4ies is o (oo4ie >unging o (oo4ie >on4ing o (oo4ie >oc4ing o (oo4ie >unching "he method that transfers A&5.1I" e9ecution to another page! but returns to the original page when it is done is

Ratnabhumi

Page 23 of 32

ashok@Ratnabhumi.com

.Net Interview Questions &erver."ransfer( &erver.Redirect( &erver.I9ecute( &erver.Return(

o o o o

.1et Deplo'ment 6uestions:


1. What do 'ou 4now about .1I" assemblies8 Answer: Assemblies are the smallest units of versioning and deplo'ment in the .1I" application. Assemblies are also the building bloc4s for programs such as Web services! Windows services! serviced components! and .1I" remoting applications. 2. What,s the Diversities between private and shared assembl'8 Answer: 5rivate assembl' is used inside an application onl' and does not have to be identified b' a strong name. &hared assembl' can be used b' multiple applications and has to have a strong name. %. What,s a strong name8 Answer: A strong name includes the name of the assembl'! version number! culture identit'! and a public 4e' to4en. *. Aow can 'ou tell the application to loo4 for assemblies at the locations other than its own install8 Answer: :se the directive in the @>7 .config file for a given application. Zprobing private5athGKc:Tm'libs/ binTdebugK =\ should do the tric4. Or 'ou can add additional search paths in the 5roperties bo9 of the deplo'ed application. -. Aow can 'ou debug failed assembl' binds8 Answer: :se the Assembl' Linding 7og #iewer (fuslogvw.e9e to find out the paths searched. 0. Where are shared assemblies stored8 Answer: Mlobal assembl' cache. 3. Aow can 'ou create a strong name for a .1I" assembl'8 Answer: With the help of &trong 1ame tool (sn.e9e . B. Where,s global assembl' cache located on the s'stem8 Answer: :suall' (:TwinntTassembl' or (:TwindowsTassembl'. C. (an 'ou have two files with the same file name in MA(8 Answer: Res! remember that MA( is a ver' special folder! and while normall' 'ou would not be able to place two files with the same name into a Windows folder! MA( differentiates b' version number as well! so it,s possible for >'App.dll and >'App.dll to co2e9ist in MA( if the first one is version 1.E.E.E and the second one is 1.1.E.E. 1E. &o let,s sa' ) have an application that uses >'App.dll assembl'! version 1.E.E.E. "here is a securit' bug in that assembl'! and ) publish the patch! issuing it under name >'App.dll 1.1.E.E. Aow do ) tell the client applications that are alread' installed to start using this new >'App.dll8 Answer: :se publisher polic'. "o configure a publisher polic'! use the publisher polic' configuration file! which uses a format similar app .config file. Lut unli4e the app .config file! a publisher polic' file needs to be compiled into an assembl' and placed in the MA(. 11. What is dela' signing8 Answer: Dela' signing allows 'ou to place a shared assembl' in the MA( b' signing the assembl' with .ust the public 4e'. "his allows the assembl' to be signed with the private 4e' at a later stage! when the development process is complete and the component or assembl' is read' to be deplo'ed. "his process enables developers to wor4 with shared assemblies as if the' were strongl' named! and it secures the private 4e' of the signature from being accessed at different stages of development.

Ratnabhumi

Page 24 of 32

ashok@Ratnabhumi.com

.Net Interview Questions

.1I" and (O> )nterop 6uestions:


1. Describe the advantages of writing a managed code application instead of unmanaged one. What,s involved in certain piece of code being managed8 Answer: "he advantages include automatic garbage collection! memor' management! support for versioning and securit'. "hese advantages are provided through .1I" F(7 and (7R/ while with the unmanaged code similar capabilities had to be implemented through third2 part' libraries or as a part of the application itself. 2. Are (O> ob.ects managed or unmanaged8 Answer: &ince (O> ob.ects were written before .1I"! apparentl' the' are unmanaged. %. &o can a (O> ob.ect tal4 to a .1I" ob.ect8 Answer: Res! through Runtime (allable Wrapper (R(W or 5)nvo4e. *. Aow do 'ou generate an R(W from a (O> ob.ect8 Answer: :se the "'pe 7ibrar' )mport utilit' shipped with &D]. tlbimp (O>ob.ect.dll =out:.1I"ob.ect.dll or reference the (O> librar' from #isual &tudio in 'our pro.ect. -. ) can,t import the (O> ob.ect that ) have on m' machine. Did 'ou write that ob.ect8 Answer: Rou can onl' import 'our own ob.ects. )f 'ou need to use a (O> component from another developer! 'ou should obtain a 5rimar' )nterop Assembl' (5)A from whoever authored the original ob.ect. 0. Aow do 'ou call unmanaged methods from 'our .1I" code through 5)nvo4e8 Answer: &uppl' a Dll)mport attribute. Declare the methods in 'our .1I" code as static extern. Do not implement the methods as the' are implemented in 'our unmanaged code! 'ou,re .ust providing declarations for method signatures. 3. (an 'ou retrieve comple9 data t'pes li4e structs from the 5)nvo4e calls8 Answer: Res! .ust ma4e sure 'ou re2declare that struct! so that managed code 4nows what to do with it. B. ) want to e9pose m' .1I" ob.ects to (O> ob.ects. )s that possible8 Answer: Res! but few things should be considered first. (lasses should implement interfaces e9plicitl'. >anaged t'pes must be public. >ethods! properties! fields! and events that are e9posed to (O> must be public. "'pes must have a public default constructor with no arguments to be activated from (O>. "'pes cannot be abstract. C. (an 'ou inherit a (O> class in a .1I" application8 Answer: "he .1I" Framewor4 e9tends the (O> model for reusabilit' b' adding implementation inheritance. >anaged t'pes can derive directl' or indirectl' from a (O> coclass/ more specificall'! the' can derive from the runtime callable wrapper generated b' the runtime. "he derived t'pe can e9pose all the method and properties of the (O> ob.ect as well as methods and properties implemented in managed code. "he resulting ob.ect is partl' implemented in managed code and partl' implemented in unmanaged code. 1E. &uppose ) call a (O> ob.ect from a .1I" applicaiton! but (O> ob.ect throws an error. What happens on the .1I" end8 Answer: (O> methods report errors b' returning ARI&:7"s/ .1I" methods report them b' throwing e9ceptions. "he runtime handles the transition between the two. Iach e9ception class in the .1I" Framewor4 maps to an ARI&:7".

.1I" Windows &ervices 6uestions


1. I9plain Windows service. Answer: Rou often need programs that run continuousl' in the bac4ground. For e9ample! an email server is e9pected to listen continuousl' on a networ4 port for incoming email messages! a print spooler is e9pected to listen continuousl' to print re;uests! and so on. What,s the :ni9 name for a Windows service e;uivalent8 Answer: Daemon.

2.

Ratnabhumi

Page 25 of 32

ashok@Ratnabhumi.com

.Net Interview Questions %. &o basicall' a Windows service application is .ust another e9ecutable8 What,s different about a Windows service as compared to a regular application8 Answer: Windows services must support the interface of the &ervice (ontrol >anager (&(> . A Windows service must be installed in the Windows service database before it can be launched. Aow is development of a Windows service different from a Windows Forms application8 Answer: A Windows service t'picall' does not have a user interface! it supports a set of commands and can have a M:) that,s built later to allow for easier access to those commands. Aow do 'ou give Windows service specific permissions8 Answer: Windows service alwa's runs under someone,s identit'. (an be &'stem or Administrator account! but if 'ou want to restrict the behavior of a Windows service! the best bet is to create a new user account! assign and den' necessar' privileges to that account! and then associate the Windows service with that new account. (an 'ou share processes between Windows services8 Answer: Res. Where,s Windows service database located8 Answer: A]IR[7O(A7[>A(A)1IT&R&"I>T(urrent(ontrol&etT&ervices What does &(> do8 Answer: &(> is Windows &ervice (ontrol >anager. )ts responsibilities are as follows: o Accepts re;uests to install and uninstall Windows services from the Windows service database. o "o start Windows services either on s'stem startup or re;uested b' the user. o "o enumerate installed Windows services. o "o maintain status information for currentl' running Windows services. o "o transmit control messages (such as &tart! &top! 5ause! and (ontinue to available Windows services. o "o loc4=unloc4 Windows service database. When developing a Windows service for .1I"! which namespace do 'ou t'picall' loo4 in for re;uired classes8 Answer: &'stem.&ervice5rocess. "he classes are &erviceLase! &ervice5rocess)nstaller! &ervice)nstaller and &ervice(ontroller. Aow do 'ou handle &tart! 5ause! (ontinue and &top calls from &(> within 'our application8 Answer: L' implementing On&tart! On5ause! On(ontinue and On&top methods. Describe the start2up process for a Windows service. Answer: >ain ( is e9ecuted to create an instance of a Web service! then Run( to launch it! then On&tart( from within the instance is e9ecuted. ) want to write a Windows service that cannot be paused! onl' started and stopped. Aow do ) accomplish that8 Answer: &et (an5auseAnd(ontinue attribute to false. What application do 'ou use to install a Windows service8 Answer: installutil.e9e Aow can 'ou see which services are running on a Windows bo98 Answer: Admin "ools 2\ (omputer >anagement 2\ &ervices and Application 2\ &ervices. Rou can also open the (omputer >anagement tool b' right2clic4ing on >' (omputer and selecting >anage from the popup menu. Aow do 'ou start! pause! continue or stop a Windows service off the command line8 Answer: net start &ervice1ame! net pause &ervice1ame and so on. Also sc.e9e provides a command2line interface for Windows services. #iew the O& documentation or proper boo4 chapters on using sc.e9e.

*. -.

0. 3. B.

C.

1E. 11. 12. 1%. 1*.

1-.

"abled points

Ratnabhumi

Page 2 of 32

ashok@Ratnabhumi.com

.Net Interview Questions

$nter%aces vs. "bstract Classes

Ratnabhumi

Page 2! of 32

ashok@Ratnabhumi.com

.Net Interview Questions

&eature >ultiple inheritance

$nter%ace "bstract class A class ma' implement several A class ma' e9tend onl' one abstract interfaces. class. An abstract class can provide complete code! default code! and=or .ust stubs that have to be overridden.

An interface cannot provide Default an' code at all! much less implementation default code.

(onstants

&tatic final constants onl'! can use them without ;ualification in classes that implement the interface. On the other paw! Loth instance and static constants are these un;ualified names possible. Loth static and instance pollute the namespace. Rou intialiser code are also possible to can use them and it is not compute the constants. obvious where the' are coming from since the ;ualification is optional. An interface implementation A third part' class must be rewritten ma' be added to an' e9isting to e9tend onl' from the abstract third part' class. class.

"hird part' convenience

)nterfaces are often used to An abstract class defines the core describe the peripheral abilities identit' of its descendants. )f 'ou of a class! not its central defined a Dog abstract class then is2a vs 2able or identit'! e.g. an Automobile Damamation descendants are Dogs! can2do class might implement the the' are not merel' dogable. Rec'clable interface! which )mplemented interfaces enumerate could appl' to man' otherwise the general things a class can do! not totall' unrelated ob.ects. the things a class is.

Ratnabhumi

Page 2" of 32

ashok@Ratnabhumi.com

.Net Interview Questions

5lug2in

Rou can write a new replacement module for an interface that contains not one stic4 of code in common with the e9isting implementations. When 'ou implement the interface! 'ou start from scratch without an' default implementation. Rou have to obtain 'our tools from other classes/ nothing comes with the interface other than a few constants. "his gives 'ou freedom to implement a radicall' different internal design.

Rou must use the abstract class as2is for the code base! with all its attendant baggage! good or bad. "he abstract class author has imposed structure on 'ou. Depending on the cleverness of the author of the abstract class! this ma' be good or bad. Another issue thatOs important is what ) call Hheterogeneous vs. homogeneous.H )f implementors=subclasses are homogeneous! tend towards an abstract base class. )f the' are heterogeneous! use an interface. (1ow all ) have to do is come up with a good definition of hetero=homogeneous in this conte9t. )f the various ob.ects are all of2a2 4ind! and share a common state and behavior! then tend towards a common base class. )f all the' share is a set of method signatures! then tend towards an interface. )f the various implementations are all of a 4ind and share a common status and behavior! usuall' an abstract class wor4s best.

)f the entire various implementations share is the Aomogeneit' method signatures! then an interface wor4s best.

>aintenance

)f 'our client code tal4s onl' in Qust li4e an interface! if 'our client terms of an interface! 'ou can code tal4s onl' in terms of an easil' change the concrete abstract class! 'ou can easil' change implementation behind it! the concrete implementation behind using a factor' method. it! using a factor' method. &low! re;uires e9tra indirection to find the corresponding method in the actual class. Fast >odern Q#>s are discovering wa's to reduce this speed penalt'. "he constant declarations in an Rou can put shared code into an interface are all presumed abstract class! where 'ou cannot into public static final! so 'ou ma' an interface. )f interfaces want to leave that part out. Rou canOt share code! 'ou will have to write call an' methods to compute other bubblegum to arrange that. Rou the initial values of 'our ma' use methods to compute the constants. Rou need not initial values of 'our constants and declare individual methods of variables! both instance and static. an interface abstract. "he' are Rou must declare all the individual all presumed so. methods of an abstract class abstract.

&peed

"erseness

Ratnabhumi

Page 2# of 32

ashok@Ratnabhumi.com

.Net Interview Questions

Adding functionalit'

)f 'ou add a new method to an )f 'ou add a new method to an interface! 'ou must trac4 down abstract class! 'ou have the option of all implementations of that providing a default implementation interface in the universe and of it. "hen all e9isting code will provide them with a concrete continue to wor4 without change. implementation of that method.

Order o% events in an asp.net pa#e Control '(ecution )i%ec cle?


*hase )nitiali+e What a control needs to do )nitiali+e settings needed during the lifetime of the incoming Web re;uest. +ethod or event to override $nit event (On$nit method

7oad view state At the end of this phase! the ,iewState )oad,iewState method propert' of a control is automaticall' populated as described in >aintaining &tate in a (ontrol. A control can override the default implementation of the )oad,iewState method to customi+e state restoration. 5rocess postbac4 data 7oad 5rocess incoming form data and update properties accordingl'. )oad*ostData method (if $*ost-ac.Data/andler is implemented

5erform actions common to all re;uests! )oad event such as setting up a database ;uer'. At this point! server controls in the tree are (On)oad method created and initiali+ed! the state is restored! and form controls reflect client2 side data. Raise change events in response to state Raise*ostDataChan#ed'vent changes between the current and previous method (if $*ost-ac.Data/andler postbac4s. is implemented

&end postbac4 change notifications

Aandle postbac4 Aandle the client2side event that caused Raise*ost-ac.'vent method(if events the postbac4 and raise appropriate events $*ost-ac.'vent/andler is on the server. implemented 5rerender 5erform an' updates before the output is *reRender event rendered. An' changes made to the state (On*reRender method of the control in the prerender phase can be saved! while changes made in the rendering phase are lost. "he ,iewState propert' of a control is Save,iewState method automaticall' persisted to a string ob.ect after this stage. "his string ob.ect is sent to the client and bac4 as a hidden variable. For improving efficienc'! a control can override the Save,iewState

&ave state

Ratnabhumi

Page 3$ of 32

ashok@Ratnabhumi.com

.Net Interview Questions

method to modif' the ,iewState propert'. Render Dispose Menerate output to be rendered to the client. 5erform an' final cleanup before the control is torn down. References to e9pensive resources such as database connections must be released in this phase. Render method Dispose method

:nload

5erform an' final cleanup before the 0n)oad event (On 0n)oad control is torn down. (ontrol authors method generall' perform cleanup in Dispose and do not handle this event.

Diversities between
Web user controls Iasier to create 7imited support for consumers who use a visual design tool A separate cop' of the control is re;uired in each application (annot be added to the "oolbo9 in #isual &tudio Mood for static la'out Web custom controls Aarder to create Full visual design tool support for consumers Onl' a single cop' of the control is re;uired! in the global assembl' cache (an be added to the "oolbo9 in #isual &tudio Mood for d'namic la'out

1he di%%erent authentication modes in the .!'1 environment


"ttribut Option e mode Description (ontrols the default authentication mode for an application. Windows &pecifies Windows authentication as the default authentication mode. :se this mode when using an' form of >icrosoft )nternet )nformation &ervices ())& authentication: Lasic! Digest! )ntegrated Windows authentication (1"7>=]erberos ! or certificates. Forms &pecifies A&5.1I" forms2based authentication as the default authentication mode.

5assport &pecifies >icrosoft 5assport authentication as the default authentication mode. 1one &pecifies no authentication. Onl' anon'mous users are e9pected or applications can handle events to provide their own authentication.

Ratnabhumi

Page 31 of 32

ashok@Ratnabhumi.com

.Net Interview Questions

Diversities between web services & remotin#


"S*.!'1 Web Services 5rotocol &tate >anagement (an be accessed onl' over A""5 Web services wor4 in a stateless environment Web services support onl' the datat'pes defined in the @&D t'pe s'stem! limiting the number of ob.ects that can be seriali+ed. .!'1 Remotin# (an be accessed over an' protocol (including "(5! A""5! &>"5 and so on 5rovide support for both stateful and stateless environments through &ingleton and &ingle(all ob.ects :sing binar' communication! .1I" Remoting can provide support for rich t'pe s'stem

"'pe &'stem

Web services support .1I" remoting re;uires the client be built interoperabilit' across platforms! and )nteroperabilit' using .1I"! enforcing homogenous are ideal for heterogeneous environment. environments. Reliabilit' Aighl' reliable due to the fact that Web services are alwa's hosted in ))& (an also ta4e advantage of ))& for fault isolation. )f ))& is not used! application needs to provide plumbing for ensuring the reliabilit' of the application.

I9tensibilit' Iase2of2 5rogramming

5rovides e9tensibilit' b' allowing us #er' e9tensible b' allowing us to to intercept the &OA5 messages customi+e the different components of during the seriali+ation and the .1I" remoting framewor4. deseriali+ation stages. Ias'2to2create and deplo'. (omple9 to program.

Ratnabhumi

Page 32 of 32

ashok@Ratnabhumi.com

Das könnte Ihnen auch gefallen