Ques: 1 What does the keyword virtual declare for a method?
Ans:
The method or property can be overridden.
Ques: 2 Tell me implicit name of the parameter that gets passed into the set property
of a class?
Ans:
The data type of the value parameter is defined by whatever data type the property is declared as.
Ques: 3 What is the difference between an interface and abstract class ?
Ans:
1. In an interface class, all methods are abstract and there is no implementation. In an abstract class some methods can be concrete.
2. In an interface class, no accessibility modifiers are allowed. An abstract class may have accessibility modifiers.
Ques: 4 How to Specify the accessibility modifier for methods inside the interface?
Ans:They all must be public, and are therefore public by default.
Ques: 5 Define interface class ?
Ans:
Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes.
Ques: 6 When you declared a class as abstract?
Ans:
1. When at least one of the methods in the class is abstract.
2. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.
Ques: 7 Define abstract class?
Ans:1. A class that cannot be instantiated. 2. An abstract class is a class that must be inherited and have the methods overridden. 3. An abstract class is essentially a blueprint for a class without any implementation
Ques: 8 How to allowed a class to be inherited, but it must be prevent the method from being over-ridden?
Ans:
Just leave the class public and make the method sealed.
Ques: 9 How to prevent your class from being inherited by another class?
Ans:
We use the sealed keyword to prevent the class from being inherited.
Ques: 10 What class is underneath the SortedList class?
Ans:
A sorted HashTable.
Ques: 11 What is the .NET collection class that allows an element to be accessed using a unique key?
Ans:
HashTable.
Ques: 12 Difference between the System.Array.Clone() and System.Array.CopyTo()?
Ans:
The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object.
Ques: 13 Difference between System.String and System.Text.StringBuilder classes?
Ans: System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
Ques: 14 What is the top .NET class that everything is derived from?
Ans:
System.Object.
Ques: 15 How can you automatically generate interface for the remotable object in .NET?
Ans:
Use the Soapsuds tool.
Ques: 16 How to configure a .NET Remoting object via XML file?
Ans:
It can be done via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config.
Ques: 17 What is Singleton activation mode?
Ans:
A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is determined by lifetime lease.
Ques: 18 What security measures exist for .NET Remoting?
Ans: None.
Ques: 19 In .NET Remoting, What are channels?
Ans:
Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred.
Ques: 20 What are remotable objects in .NET Remoting?
Ans:
1. They can be marshaled across the application domains.
2. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.
Ques: 21 Do you know the proxy of the server object in .NET Remoting?
Ans: This process is known as marshaling. It handles the communication between real server object and the client object. We can say that It’s a fake copy of the server object that resides on the client side and behaves as if it was the server.
Ques: 22 Give your idea when deciding to use .NET Remoting or ASP.NET Web Services? Ans:
1. Remoting is a more efficient communication exchange when you can control both ends of the application involved in the communication process. 2. Web Services provide an open-protocol-based exchange of informaion. Web Services are best when you need to communicate with an external organization or another (non-.NET) technology.
Ques: 23 Define the possible implementations of distributed applications in .NET?
Ans:.
NET Remoting and ASP.NET Web Services. If we talk about the Framework Class Library, noteworthy classes are in System.Runtime.Remoting and System.Web.Services.
Ques: 24 Explain what relationship is between a Process, Application Domain, and Application?
Ans:A process is an instance of a running application. An application is an executable on the hard drive or network. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application.
Ques: 25 What’s typical about a Windows process in regards to memory allocation?
Ans:Each process is allocated its own block of available RAM space, no process can access another process’ code or data. If the process crashes, it dies alone without taking the entire OS or a bunch of other applications down.
Ques: 26 What’s a Windows process?
Ans:It’s an application that’s running and had been allocated memory.
Ques: 27 Using XSLT, how would you extract a specific attribute from an element in an XML document?
Ans:Successful candidates should recognize this as one of the most basic applications of XSLT. If they are not able to construct a reply similar to the example below, they should at least be able to identify the components necessary for this operation: xsl:template to match the appropriate XML element, xsl:value-of to select the attribute value, and the optional xsl:apply-templates to continue processing the document.
Ques: 28 What is SOAP and how does it relate to XML?
Ans:The Simple Object Access Protocol (SOAP) uses XML to define a protocol for the exchange of information in distributed computing environments. SOAP consists of three components: an envelope, a set of encoding rules, and a convention for representing remote procedure calls. Unless experience with SOAP is a direct requirement for the open position, knowing the specifics of the protocol, or how it can be used in conjunction with HTTP, is not as important as identifying it as a natural application of XML.
Ques: 29 What is main difference between Global.asax and Web.Config?
Ans:ASP.NET uses the global.asax to establish any global objects that your Web application uses. The .asax extension denotes an application file rather than .aspx for a page file. Each ASP.NET application can contain at most one global.asax file. The file is compiled on the first page hit to your Web application. ASP.NET is also configured so that any attempts to browse to the global.asax page directly are rejected. However, you can specify application-wide settings in the web.config file. The web.config is an XML-formatted text file that resides in the Web site’s root directory. Through Web.config you can specify settings like custom 404 error pages, authentication and authorization settings for the Web site, compilation options for the ASP.NET Web pages, if tracing should be enabled, etc
Ques: 30 What is the difference between the value-type variables and reference-type variables in terms of garbage collection?
Ans:The value-type variables are not garbage-collected, they just fall off the stack when they fall out of scope, the reference-type objects are picked up by GC when their references go null.
Ques: 31 Where do the reference-type variables go in the RAM?
Ans:The references go on the stack, while the objects themselves go on the heap. However, in reality things are more elaborate.
Ques: 32 What’s the difference between struct and class in C#?
Ans:1. Structs cannot be inherited. 2. Structs are passed by value, not by reference. 3. Struct is stored on the stack, not the heap.
Ques: 33 To test a Web service you must create a windows application or Web application to consume this service?
Ans:The webservice comes with a test page and it provides HTTP-GET method to test.
Ques: 34 What is the transport protocol you use to call a Web service?
Ans: SOAP is the preferred protocol.
Ques: 35 Can you give an example of what might be best suited to place in the Application Start and Session Start subroutines?
Ans:This is where you can set the specific variables for the Application and Session objects.
Ques: 36 Where do you store the information about the user’s locale?
Ans:System.Web.UI.Page.Culture
Ques: 37 Where does the Web page belong in the .NET Framework class hierarchy?
Ans:System.Web.UI.Page
Ques: 38 Name two properties common in every validation control?
Ans:ControlToValidate property and Text property
Ques: 39 What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?
Ans:You must set the DataSource property and call the DataBind method.
Ques: 40 How can you provide an alternating color scheme in a Repeater control?
Ans:Use the AlternatingItemTemplate
Ques: 41 Which template must you provide, in order to display data in a Repeater control?
Ans:
ItemTemplate Ques: 42 Can you edit data in the Repeater control?
Ans:No, it just reads the information from its data source
Ques: 43 Which method do you invoke on the DataAdapter control to load your generated dataset with data?
Ans:The .Fill() method
Ques: 44 Describe the difference between inline and code behind.
Ans:Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.
Ques: 45 What’s a bubbled event?
Ans:When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.
Ques: 46 What is the role of global.asax.
Ans:Store global information about the application
Ques: 47 Can the action attribute of a server-side <form> tag be set to a value and if not how can you possibly pass data from a form page to a subsequent page.
Ans:No, You have to use Server.Transfer to pass the data to another page.
Ques: 48 Can you give an example of when you might use it?
Ans:When you want to inherit (use the functionality of) another class. Base Class Employee. A Manager class could be derived from the Employee base class.
Ques: 49 Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Ans:1. A DataSet can represent an entire relational database in memory, complete with tables, relations, and views. 2. A DataSet is designed to work without any continuing connection to the original data source. 3. Data in a DataSet is bulk-loaded, rather than being loaded on demand.
Ques: 50 What is the difference between Server.Transfer and Response.Redirect?
Ans:1. Server.Transfer() performs server side redirection of the page avoiding extra round trip. While The Response .Redirect () method can be used to redirect the browser to specified url. 2. Server.Transfer is used to post a form to another page. Response.Redirect is used to redirect the user to another page or site.
Ques: 51 Explain the difference between a database administrator and a data administrator.
Ques: 52 What is smart navigation?
Ans:Smart navigation is, cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.
Ques: 53 What is the difference between Literal and Lable Control?
Ans:We use literals control if we want to typed text using HTML formating and without using property.We typed HTML code in .cs file when used literals. Lable control when displayed already formated.Typed text can not be formated in .cs file.
Ques: 54 What are the 2 Layouts supported by a Web form in ASP.NET?
Ans:1. Grid layout: Pages using grid layout will not always display correctly in non-Microsoft browsers,and controls are placed exactly where they draw.It means they have absolute positions on the page. Use grid layout for Microsoft Windows–style applications, in which controls are not mixed with large amounts of text. 2. Flow layout: Controls relative to other elements on the page. Controls that appear after the new element move down if you add elements at run time. Flow layout for document-style applications, in which text and controls are intermingled.
Ques: 55 Can you specify authorization settings both in Web.config and in IIS?
Ans:Yes,It wil be done. For this, the IIS setting is evaluated first and then the setting in Web.config is evaluated. Hence we can say,the most restrictive setting will be used.
Ques: 56 How do you determine, what is the role of the current user?
Ans:The User object provides an IsInRole method to determine the role of the current user, as shown in the following example: if(User.IsInRole("Administrators")) { /////// }
Ques: 57 How do you get a User Identity?
Ans:Using the User object’s Identity property. The Identity property returns an object that includes the user name and role information, as shown in the following code: private void Page_Load(object sender, System.EventArgs e) { Label1.Text = User.Identity.IsAuthenticated.ToString(); Label2.Text = User.Identity.Name; Label3.Text = User.Identity.AuthenticationType; }
Ques: 58 What is the default authentication method when you create a new Web application project?
Ans:Windows authentication is the default authentication method when you create a new Web application project. Ques: 59 What is the advantage of using Windows authentication in a Web application? Ans:The advantage of Windows authentication: 1. Web application can use the exact same security that applies to your corporate network like user names, passwords, and permissions. 2. To access the Web application users logged on to the network. It is importent that user does'nt logged on again.
Ques: 60 What do you mean by neutral cultures?
Ans:Neutral cultures represent general languages, such as English or Spanish and a specific language and region.ASP.NET assigns that culture to all the threads running for that Web application.When user set culture attribute for a Web application in Web.config.ASP.NET maintains multiple threads for a Web application within the aspnet_wp.exe worker process.
No comments:
Post a Comment