Accessor: A method that sets or retrieves the value of a private data member value that is associated with a property. Read-write properties have get and set accessors. Properties that are read-only have only a get accessor.
Constructor: A special method on a class or struct that initializes the objects of that type.
Destructor: A special method on a class or struct that prepares the instance for destruction by the system.
Field: A data member of a class or struct that is accessed directly.
Generics: Generics allow you to define a class and or method that are defined with a type Parameter. When client code instantiates the type, it specifies a particular type as an argument.
Property: A data member accessed by means of an accessor.
Refactoring: Reusing previously entered code.
Q. What is polymorphism?
Q. What are the difference between Abstruct class and Interface?
* An Interface cannot implement methods.
* An abstract class can implement methods.
* An Interface can only inherit from another Interface.
* An abstract class can inherit from a class and one or more interfaces.
* An Interface cannot contain fields.
* An abstract class can contain fields.
* An Interface can contain property definitions.
* An abstract class can implement a property.
* An Interface cannot contain constructors or destructors.
* An abstract class can contain constructors or destructors.
* An Interface can be inherited from by structures.
* An abstract class cannot be inherited from by structures.
* An Interface can support multiple inheritance.
* An abstract class cannot support multiple inheritance.
Q. What is WSDL?
ANS: WSDL stands for Web Services Description Language which is an XML document used to describe Web services and also used to locate Web services.
Q. Describe ASP.NET page lifecycle.
ANS:
Page request:
The page request occurs before the page life cycle begins. When the page is requested by a user, ASP.NET determines whether the page needs to be parsed and compiled (therefore beginning the life of a page), or whether a cached version of the page can be sent in response without running the page.
Start:
In the start step, page properties such as Request and Response are set. At this stage, the page also determines whether the request is a postback or a new request and sets the IsPostBack property. Additionally, during the start step, the page’s UICulture property is set.
Page initialization:
During page initialization, controls on the page are available and each control’s UniqueID property is set. Any themes are also applied to the page. If the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state.
Load:
During load, if the current request is a postback, control properties are loaded with information recovered from view state and control state.
Validation:
During validation, the Validate method of all validator controls is called, which sets the IsValid property of individual validator controls and of the page.
Postback event handling:
If the request is a postback, any event handlers are called.
Rendering:
Before rendering, view state is saved for the page and all controls. During the rendering phase, the page calls the Render method for each control, providing a text writer that writes its output to the OutputStream of the page’s Response property.
Unload:
Unload is called after the page has been fully rendered, sent to the client, and is ready to be discarded. At this point, page properties such as Response and Request are unloaded and any cleanup is performed.
PAGE EVENTS:
PreInit -> Init -> InitComplete -> PreLoad -> Load -> [Control events] -> LoadComplete -> PreRender -> SaveStateComplete -> Render -> Unload.
Q. What is sealed class? How is it different from private class?
Q. What are the difference between char and varchar?
ANS: The CHAR is a fixed-length character data type, the VARCHAR is a variable-length character data type. CHAR should be used for storing fix length character strings. String values will be space/blank padded before stored on disk. If this type is used to store variable length strings, it will waste a lot of disk space.
Q. What are cursor, view and trigger?
Cursors are special programming constructs that allow data to be manipulated on a row-by-row basis, similar to other structured programming languages. They are declared like a variable, and then move one record at a time using a loop for control. There are three types of cursors, DYNAMIC, STATIC, and KEYSET. There are also three types of locks for cursors, READ ONLY, SCROLL LOCKS, and OPTIMISTIC.
Benefit – Fetch more records at time for that purpose you can use Cursor.
A View is a logical construct in the database. You basically create a virtual table in the database with a pre-defined query. Any other query can use the view.
Triggers are a special PL/SQL construct similar to procedures. However, a procedure is executed explicitly from another block via a procedure call, while a trigger is executed implicitly whenever the triggering event happens. The triggering event is an INSERT, DELETE, or UPDATE command. The timing can be either BEFORE or AFTER. The trigger can be either row-level or statement-level, where the former fires once for each row affected by the triggering statement and the latter fires once for the whole statement.
Q. What are the difference between primary key and unique key?
*Primary key should not contain nulls but unique key can contains null values.
*There is only one Primary key for one table but there may be more than one
Unique Key in a table.
Q. What is indexing?
Indexes are database tools that increase the system’s ability to retrieve data by not scanning all of the data records in search of the desired record(s). Indexes can change the organization of data so that it is structured similarly to how it will be accessed for retrieval. The indexes are created on column(s) to help the database find data based upon the value(s) contained in those indexed column(s).
Index Drawbacks:
Indexes are a performance drag when the time comes to modify records. Any time a query modifies the data in a table the indexes on the data must change also. Achieving the right number of indexes will require testing and monitoring of your database to see where the best balance lies. Static systems, where databases are used heavily for reporting, can afford more indexes to support the read only queries. A database with a heavy number of transactions to modify data will need fewer indexes to allow for higher throughput. Indexes also use disk space. The exact size will depends on the number of records in the table as well as the number and size of the columns in the index. Generally this is not a major concern as disk space is easy to trade for better performance.
Q. How do you remove duplicate entries from a table?
ANS:
EMPID EMPNAME EMPSSN
———- ———- ———–
1 Jack 555-55-5555
2 Joe 555-56-5555
3 Fred 555-57-5555
4 Mike 555-58-5555
5 Cathy 555-59-5555
6 Lisa 555-70-5555
7 Jack 555-55-5555
8 Mike 555-58-5555
9 Cathy 555-59-5555
10 Lisa 555-70-5555
11 Lisa 555-70-5555
delete from employee
where (empid, empssn)
not in
( select min(empid), empssn
from employee group by empssn); => EMPID Unique.
delete from employee
where (rowid, empssn)
not in
(select min(rowid), empssn from employee group by empssn); => Duplicate records once again but this time the empids and empSSNs are the same.
Q. What is MDAC (Microsoft Data Access Components)?
ANS: ADO, ODBC and OLE DB
Q. Difference between Application and Session?
An application variable exists from when the application is first ‘run’ (The first time a page in the app is used) and exists until the application is stopped on the server, either through IIS or the actual machine being turned off or rebooted.
A session variable is created for the instance of the browser accessing the site and will only be available until that browser is closed or the session times out.
Q. Assemblies:
An assembly is a fundamental building block of any .NET Framework application. For example, when you build a simple C# application, Visual Studio creates an assembly in the form of a single portable executable (PE) file, specifically an EXE or DLL.
Assemblies contain metadata that describe their own internal version number and details of all the data and object types they contain. This is known as Assembly Manifest.
Assemblies have the following properties:
*Assemblies are implemented as .exe or .dll files.
*You can share an assembly between applications by putting it in the Global Assembly Cache.
*Assemblies must be strong-named before they can be included in the Global Assembly Cache.
*Assemblies are only loaded into memory if they are required.
*You can programmatically obtain information about an assembly by using reflection.
*You can use two versions of the same assembly in a single application.
A private assembly is an assembly that is deployed with an application and is available for the exclusive use of that application. That is, other applications do not share the private assembly. Private assemblies are one of the methods that can be used to create isolated applications.
A shared assembly is an assembly available for use by multiple applications on the computer.
Difference:
* A private assembly is not required to be signed, and publickeyToken is not required in the <assemblyIdentity> element of the assembly manifest.
* Private assemblies can be installed into the application’s folder using any installation technology. Private assemblies are not required to be installed using the Windows Installer.
Q. Five(5) new features added in ASP.NET 2.0.
1. Master Page
2. App_Code
3. App_Data
4. Themes and Skins
5. <%$ … %>
6. 64-Bit Support