Technical Interview -1 in ILink, Chennai
I am Venkatesan - Recently I attended Interview in Chennai at ILink Solutions.This is the First Round of Technical Interview , it Contains only Basic Question. Here I am sharing the Experience.For few Question I don't have Clear answer so I have just found the answers on the articles on sites & then placed here for others - to know the Answer
1) What is the use of ViewState ?
Viewstate is a Client-side state management
It will retain the Value across postback within the same page.
ViewState["strAddress"] = txtAddress.Text;
After Postback ie: after clicking the button
you get the address through viewsate
string getAddress = ViewState["strAddress"].ToString();
2) Give Syntax For Stored Procedure ?
CREATE PROCEDURE usp_InsertGroup
INSERT INTO Groups
(GroupID, GroupName, GroupDescription, LastUpdateDate)
VALUES(inGroupID, inGroupName, inGroupDescription, SYSDATE);
3) What are the Access Modifier and Explain ?
* public: any code may access the class or class member.
* private: the class or class member is not accessible outside of the class that contains it (yes, in advanced cases, you can put a class inside another class).
* protected: the class or class member is only accessible by the class that contains it, or any subclass of that class.
* internal: the class or class member is only accessible by code in the same assembly (DLL).
* protected internal: the class or class member is accessible by code in the same assembly (DLL), or by any subclass of the class that contains it.
4) How to Handle the Error in your application through Global.asax file ? [ any helper class you have used ]
What i said is, I will redirect to error.aspx page if any exception throws so the email will send to the email regarding the error - it has been set through form authentication - Customerrors - pass the page name on Defaultredirect.
5) What are the Global.asax Events ?
As with traditional ASP, used to set up an application environment and only called when the application first starts.
This method occurs after _start and is used for initializing
This method is invoked before destroying an instance of an application.
Again, like classic ASP, used to clean up variables and memory when an application ends
This event is used when a client makes a request to any page in the application. It can be useful for redirecting or validating a page request.
After a request for a page has been made, this is the last event that is called.
As with classic ASP, this event is triggered when any new user accesses the web site.
As with classic ASP, this event is triggered when a user's session times out or ends. Note this can be 20 mins (the default session timeout value) after the user actually leaves the site.
There are still some more events are there you can check it here
[ I do no how shall i handle the errors using Helpers Class if anyone know let you post your Answers ]
6) Session ?
Its a Server-side Management.
Session will hold the value or data throughout the entire project. so i can acess the session data anywhere within the project.
Default timeout is 20 Minutes.
7) Static Variable ?
A variable that retains the same data throughout the execution of a program. In contrast, a dynamic variable can have different values during the course of a program.
8) Polymorphism ?
Polymorphism means same operation may behave differently on different classes.
Example of Compile Time Polymorphism: Method Overloading
Example of Run Time Polymorphism: Method Overriding
- Method with same name but with different arguments is called method overloading.
- Method Overloading forms compile-time polymorphism.
- Method overriding occurs when child class declares a method that has the same type arguments as a method declared by one of its superclass.
- Method overriding forms Run-time polymorphism.
- Note: By default functions are not virtual in C# and so you
need to write “virtual" explicitly. While by default in Java each function are virtual.
Delegate is type which holds the method(s) reference in an object. It is also reffered as a type safe function pointers.
* Encapsulating the method's call from caller.
* Effective use of Delegat improves the performance of
* Used to call a method asynchronously.
public delegate type_of_delegate delegate_name()
Example : public delegate int mydelegate(int delvar1,int delvar2)
10) What is Triggers in SQL ?
A database trigger is procedural code that is automatically executed in response to certain events on a particular table in a database.
Triggers can restrict access to specific data, perform logging, or audit data modifications.
There are two classes of triggers, they are either "row triggers" or "statement triggers".
With row triggers you can define an action for every row of a table,
while statement triggers occur only once per INSERT, UPDATE, or DELETE
statement. Triggers cannot be used to audit data retrieval. Each class can be of several types.
There are "BEFORE triggers" and "AFTER triggers" which identifies the time of
execution of the trigger. There is also an "INSTEAD OF trigger" which is a
conditional trigger that will fire instead of the triggering statement. However, "INSTEAD OF trigger" are available only for views.
There are typically three triggering EVENTS that cause trigger to 'fire':
INSERT event (as a new record is being inserted into the database).
UPDATE event (as a record is being changed).
DELETE event (as a record is being deleted).
The SQL:2003 standard mandates that triggers give programmers access to record variables by means of a syntax such as REFERENCING NEW AS n. For example, if a trigger is monitoring for changes to a salary column one could write a trigger like the following:
11) What is View in SQL Server ?
A view is a virtual table that consists of columns from one or more tables. Though it is similar to a table, it is stored in the database. It is a query stored as an object. Hence, a view is an object that derives its data from one or more tables.
These tables are referred to as base or underlying tables.Once you have defined a view, you can reference it like any other table in a database.
A view serves as a security mechanism. This ensures that users are able to retrieve and modify only the data seen by them. Users cannot see or access the remaining data in the underlying tables. A view also serves as a mechanism to simplify query execution. Complex queries can be stored in the form as a view,
and data from the view can be extracted using simple queries.
12) Difference between Datareader and Dataset ?
1. It is a read only and forward only data.
2. You can access one table at time.
3. It can't persist the data.
4. It is comes under connected architecture.
5. One of the most advantage is it is much faster than data adapter
1. It is defined with multiple tables.
2. It can persist the data.
3. It is a relational data cache hosted in application domain during execution.
4. It is a disconnected architecture.
5. It can't defined with out data adapter.
Note: Here is the Link for the Technical Round - 2.
the Interview Q & A r good.
i have doubt whether viewatate is client or server state management.plz clarify it.