Answer:
Page Request >> Start >> Page Init >> Page Load >> Validation >> PostBack Event Handling >> Page Rendering >> Page Unload, where as:
- Page Request - When the page is requested ASP.Net determines whether the page is to be parsed and compiled or a cached verion of the page is to be sent without running the page.
- Start - Page propertied REQUEST and RESPONSE are SET, if the page is pastback request then the IsPostBack property is SET and in addition to this UICulture property is also SET.
- Page Initilization - In this the UniqueID of each property is SET. If the request was postback the data is not yet loaded from the viewstate.
- Page Load - If it was a postback request then the data gets loaded in the control from the ViewState and control property are set.
- Validation - If any control validation present, they are performed and IsValid property is SET for each control.
- PostBack Event Handling - If it was a postback request then any event handlers are called.
- Page Rendering - Before this the viewstate is saved from the page and RENDER method of each page is called.
- Page Unload - Page is fully rendered and sent to the client (Browser) and is discarded. Page property RESPONSE and REQUEST are unloaded.
2. What are indexes .NET?
Answer:
Indexes are set up as a subset of data from the column it is created in an index table and a set of pointers to the physical table itself. The index tables are updated when data is inserted, updated or deleted. This can actually have negative performance impact if indexes are unnecessarily created. The overuse of indexes can become as much as burden to the application as not having indexes.
3. What are the Collection classes?
Answer:
Queue, Stack, BitArray, HashTable, LinkedList, ArrayList, NameValueCollection, Array, SortedList , HybridDictionary, ListDictionary, StringCollection, StringDictionary
4. Differences between application and session?
Answer:
The application level variable hold value at the application level and their instances are destroyed when the no more client access that application, whereas session correspond to a individual user accessing the application.
5. What is web application virtual directory?
Answer:
- A virtual directory appears to client browsers as though it were contained in a Web server’s root directory, even though it can physically reside somewhere else.
- By defalut it’s - inetpub/wwwroot
6. If cookies is disabled in client browser, will session tracking work?
Answer:
No, maintaning value in cokkie woont be possible. In that case you have to make use of other ways to maintain state of the data on page. You can check whether client support cookies or not by using Request->Browser->Cookies->Property.
7. What is a Process, Sesion and Cookie?
Answer:
Process - Instance of the application
Session - Instance of the user accessing the application
Cookie - Used for storing small amount of data on client machine.
8. Explain serialization?
Answer:
- Serialization is a process of converting an object into a stream of bytes.
- .Net has 2 serializers namely XMLSerializer and SOAP/BINARY Serializer.
- Serialization is maily used in the concept of .Net Remoting.
9. Explain friend and protected friend?
Answer:
Friend/Internal - Method, Properties in a class can be accessed by all the classes within that particular assembly.
Protected Friend/Protected Internal - Methods, Properties can be accessed by all the classes in that particular assembly and also by the child classes of that particular class.
10. What are Abstract base classes?
Answer:
- Abstact Class is nothing but a true virtual class..
- This class cannot be instantiated instead it has to be inherited.
- The method in abstract class are virtual and hence they can be overriden in the child class.
- Its purpose is to act as a base class from which other classes may be derived.
11. What is difference between interface inheritance and class inheritance?
Answer:
Interface inheritance -
a. The accessibility modifier in Interface is public by defalut.
b. All the methods defined in the interface class should be oveririden in the child class.
Class Inheritance -
a. There is not restriction on the acessibility modifier in a class.
b. Only the method that are defined virtual should be overriden.
12. What are object-oriented concepts?
Answer:
Class: The formal definition of an object. The class acts as the template from which an instance of an object is created at run time. The class defines the properties of the object and the methods used to control the object’s behavior.
Object: An object is an instance of a class.
Encapsulation: hides detailed internal specification of an object, and publishes only its external interfaces. Thus, users of an object only need to adhere to these interfaces. By encapsulation, the internal data and methods of an object can be changed without changing the way of how to use the object.
Inheritance: A class that derives from another class - known as the base class - inherits the same methods and properties. This promotes reuse and maintainability.
Abstraction: the describing of objects by defining their unique and relevant characteristics (properties). Whilst an object may have 100s of properties normally only those properties of importance to the situation are described. (eg life policies premiums are normally important; whereas the time of day a policy was purchased is not usually of value).
Polymorphism: Allows objects to be represented in multiple forms. Even though classes are derived or inherited from the same parent class, each derived class will have its own behavior. (Overriding and hiding methods)
13. When is web.config called?
Answer:
Web.config is an xml configuration file. It is never directly called unless we need to retrieve a configurations setting. Each application can have only one web.config
14. What does connection string consist of?
Answer:
Server, user id, password, database name. The connection string is stored in the web.config
15. What are the types of threading models?
Answer:
Single Threading: This is the simplest and most common threading model where a single thread corresponds to your entire application’s process.
Free Threading: The most complex threading model. Unlike STA, threads are not confined to their own apartments. Multiple treads can make calls to the same methods and same components at the same time.
16. What is a runtime host?
Answer:
The runtime host is the environment in which the CLR is started and managed.
17. Describe the techniques for optimising your application?
Answer:
- Avoid round-trips to server. Perform validation on client.
- Save viewstate only when necessary.
- Employ caching.
- Leave buffering on unless there is a dire need to disable it.
- Use connection pooling.
- Use stored procedures instead of in-line SQL or dynamic SQL.
18. Different between EXE and DLL files?
Answer:
a) EXE has an entry point, therefore, a DLL can be changed into an EXE, if it's provided an main entry function.
b) If DLL is getting destroyed, EXE also destroyed.
or
DLL is a in-process server while exe is a out-process server it means dll works within the thread of application while exe works after creating its own thread.
19. ASP.NET objects?
Answer:
Request, Response, Server, Session, Application.
20. What is side by side execution?
Answer:
Asynchronous execution in which application keeps on running instead of waiting for the result of previous stage execution.
21. About a class access specifiers and method access specifiers
Answer:
a) Public : available throughout application.
b) Private : available for class and its inherited class.
c) Protected : restricted to that class only.
d) Internal : available throughout that assembly.
22. What is isPostback property?
Answer:
It is a property of page to check weather the page is loaded first time or in response to the client callback.
23. Can a try block have more than one catch block?
Answer:
Yes, a try block can have any number of catch block but only one will execute which matches the error!
24. How to load an assembly at runtime?
Answer:
Reflection to load assembly dynamically and getting interface information and instantiating the assembly dynamically. You can also get all the methods names, OR An assembly can be loaded and its method are called dynamically using Reflection.
25. Rich vs thin Clients?
Answer:
A thin client machine is going to communicate with a central processing server, meaning there is little hardware and software installed on the user’s machine. At times, thin may be defined as simply not needing the software or operating system installed on the user machine. This allows all end users’ systems to be centrally managed and software deployed on a central server location as opposed to installed on each individual system.
Thin clients are really best-suited to environments in which the same information is going to be accessed by the clients, making it a better solution for public environments. For this reason, thin clients are often deployed in hotels and airports, where installing software to all systems wouldn’t make sense. It would be a massive headache for IT to both deploy and maintain.
When using thin clients, compared to a feature-rich desktop PCs today, they often tend to look a bit primitive and outdated. Since many thin clients run on very little hardware, it is impossible to incorporate rich graphical user interfaces. To use the client, an input device (keyboard) and viewing device (display) is usually the basic requirements. Some may not even require a mouse.
In contrast, a thick client will provide users with more features, graphics and choices making the applications more customizable. Unlike thin clients, thick clients do not rely on a central processing server because the processing is done locally on the user system, and the server is accessed primarily for storage purposes. For that reason, thick clients often are not well-suited for public environments. To maintain a thick client, IT needs to maintain all systems for software deployment and upgrades, rather than just maintaining the applications on the server. Additionally, thick clients often require operating specific applications, again posing more work and limitations for deployment. The trade-off is a more robust and local computing environment.
26. Compare Client server application with n-Tier application
Answer:
Client Server Application is a simple 2-tier application where there are only 2 tiers involved that are Presentation and DB. The Client tier represents the UI where as the Server tier represents the Business rules and Database. There is no separation of Business Logic from Database. Everything is coupled in a same tier. Usually, Client Server Architecture is used for the small scaled systems where the Business Logic is not so complex & lengthy at the same time it does not require frequent updating.
The n-Tier Application Architecture is usually a 3 tier or more tier application architecture where each tier represents a different layer of the application. In case of 3 tier architecture, it comprises Presentation Tier, Business Logic Tier and Database Tier. In case of n-tier architecture, we can use another tier for any 3rd party package to integrate in our application. The biggest advantage of using n-tier architecture is to manage the application layers efficiently. In case of an update in any tier of an application does not affect the whole application to shutdown or to put it on hold. In majority of the cases, the Business Logic requires updating frequently in any medium to large scaled projects hence for any Business Application; it is useful to implement n-Tier Architecture instead of simple Client Server Application Architecture.
27.