Interview Questions Part 4 – Answers

November 5, 2009

 

TCS Mumbai

—————-

Locks
Concurrency
Error handling in Sql server 
      @@Rowcount , @@Error

Error handling in .Net                                                                                                                                                             Ans: try catch block can be used
How to pass parameters in stored procedures
     IN , OUT parameters

 

Passing Input and output parameters to SP:

create procedure sproc_employees

(
  @a1 int,
  @a1 int out
)
as
begin
set @a1 =(select count(*) from employees_u where employeeID<@a1)
return @a1
end

Declare @op int
EXEC sproc_employees 5,@op OUT
PRINT @op

create proc sp_nam( @a1 IN, @a1 OUT)
     Can we used the same parameter name as input and output.?

    Ans: No,we cannot give same parameter as input and output,it will throw error- “Variable names must be unique within a query batch or stored procedure”

 

 

 

Using the same parameter as input and output:

 

 

CREATE  PROCEDURE [dbo].[SP_GetEmpDetails]
(
@name  varchar(50) output,
@Empsalary varchar(50) output
)
as
BEGIN
 set  @name =(select EmployeeID from employees_u where LastName=@name)
 set  @Empsalary =(select Title from employees_u where EmployeeID=@name)
select @name,@Empsalary
End

 

Declare @op int
EXEC SP_GetEmpDetails ‘usha’,@op OUT

 

Here the first paramter is used as both input and output parameter.

 

Can we configure the Server of our application with 2 different versions of      
     Asp.net

What is Polymorphism?
In function overloading can we  write as below:
 

  i. functionname(int a1)

         samefunctionname(float a1)

      ii. function(int a1)

          samefunction(int a1,int b1)

 

Can we remove global.asax file from our application?                                                                                                    Ans: When we create a new web application global.asax file is not added automatically so even if the file is not there the application works fairly well.we can add the file explicitly.
What is the use of global.asax file                                                                                              http://msdn.microsoft.com/en-us/library/1xaas8a2(VS.71).aspx                                                                                                                                                       Ans:The Global.asax file, also known as the ASP.NET application file, is an optional file that contains code for responding to application-level events raised by ASP.NET or by HttpModules. The Global.asax file resides in the root directory of an ASP.NET-based application.The Global.asax file is optional. If you do not define the file, the ASP.NET page framework assumes that you have not defined any application or session event handlers.     
What are the events in global.asax file                                                                                                                            Ans: http://www.dotnetcurry.com/ShowArticle.aspx?ID=126&AspxAutoDetectCookieSupport=1#                                                                               
The Global.asax, also known as the ASP.NET application file, is located in the root directory of an ASP.NET application. This file contains code that is executed in response to application-level and session-level events raised by ASP.NET or by HTTP modules. You can also define ‘objects’ with application-wide or session-wide scope in the Global.asax file. These events and objects declared in the Global.asax are applied to all resources in that web application.
Methods corresponding to events that fire on each request
Application_BeginRequest() – fired when a request for the web application comes in.
Application_AuthenticateRequest –fired just before the user credentials are authenticated. You can specify your own authentication logic over here.
Application_AuthorizeRequest() – fired on successful authentication of user’s credentials. You can use this method to give authorization rights to user.
Application_ResolveRequestCache() – fired on successful completion of an authorization request.
Application_AcquireRequestState() – fired just before the session state is retrieved for the current request.
Application_PreRequestHandlerExecute() – fired before the page framework begins before executing an event handler to handle the request.
Application_PostRequestHandlerExecute() – fired after HTTP handler has executed the request.
Application_ReleaseRequestState() – fired before current state data kept in the session collection is serialized.
Application_UpdateRequestCache() – fired before information is added to output cache of the page.
Application_EndRequest() – fired at the end of each request
Methods corresponding to events that do not fire on each request
Application_Start() – fired when the first resource is requested from the web server and the web application starts.
Session_Start() – fired when session starts on each new user requesting a page.
Application_Error() – fired when an error occurs.
Session_End() – fired when the session of a user ends.
Application_End() – fired when the web application ends.
Application_Disposed() – fired when the web application is destroyed.
                                           
Can we have more than 2 machine.config files in IIS servers?
         Ans: 2 machine.config files  can be present in a machine ,machine.config files will be located  in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG and it depends on the numver of .NET framework versions installed in the machine.

       Can we install 2 IIS versions in one system?

 what is the use of web.config and machine.config files? What is the difference between these 2 files?
What is the difference between HTML server control and Web Server control?
Say something about Datagrid? What is the use of Bound Columns? We gave AutoGenerateColumns = True and we have 3 BoundColumns out of 5 columns. How many columns are displayed in the grid? Ans: 5
 What is the use of autogenerate columns?                                                                                                                   Ans: If the DataGrid control’s AutoGenerateColumn property is set to true, the control will generate and display a bound column for each bindable column in the data source, the column names in the grid can be specified explicitly by setting it to false
Which one is better DataReader/DataSet in terms of performance?                           Ans:http://www.dotnetfunda.com/articles/article74.aspx                                                                                                               We should use a DataSet populated by SqlDataAdapter when
1. We require a disconnected memory-resident cache of data so that we can pass to different component or layers
2. We are working wtih data retrived from multiple data sources.
3. We want to update some of all retrieved rows using batch updated provided by SqlDataAdapter
4. We want to perform data binding against a control that requires a data source that spport IList such as GridView, Repeater etc.                                                                   
We should use SqlDataReader by calling ExecuteReader method of SqlCommand object when
1. We are dealing with large volumes of data – too much to maintain in single cache.
2. We want to reduce the memory occupied by the application (using DataSet consumes memory)
3. We want to perform data binding with a control that supports a data source that implements IEnumerable
 Can we pass null values to stored procedures?
 Difference b/w Order BY and GROUP BY in SQL?                                                                                                            Ans: Groupby: It is a way to sub-total your results,or perform some other ‘aggregate’ functions on them.
Orderby: It is a simply a way to sort your results. It doesn’t affect what shows up in your result set,only what order it is displayed.                       http://stackoverflow.com/questions/1277460/what-is-the-difference-between-group-by-and-order-by-in-sql
How to submit one page information to another? Which methods are used? Ans: POST and GET 
POST  : Request.Form

GET :    Request.QueryString

 

If we are using Request then what is the default method it takes?

Ans : QueryString (doubt)  .Default Method of form is GET

Difference b/w Response.Redirect and Server.Transfer?
Ans:http://www.dotnetspider.com/resources/30822-Server-Transfer-Server-Execute.aspx

http://www.dotnetspider.com/forum/ViewForum.aspx?ForumId=21599

Server.Transfer processes the page from one page directly to the next page without making a round-trip back to the client’s browser. This way is faster, with a little less overhead on the server. However, it does NOT update the clients url history list or current url.

Response.Redirect, as expected, is used to redirect the user’s browser to another page or site. It DOES perform a trip back to the client where the client’s browser is actually redirected to the new page. The browser history list is updated to reflect the new address.
 

Can we connect 2 different databases of Sqlserver to our application? How to connect?
Can we connect oracle and sqlserver at the same time?
In web.config  <errors mode=Debug ,none,remote
In web.config <trace  mode = verbose, none
In web.config <sessionstate mode=sqlserver , stateserver inproc,outproc,stateserver
How to debug javascript function in frontend?  Ans: IE -> Tools -> Internet Options-> Advanced ->Uncheck  “Disable Script Debugging (IE)” and “Disable Script Debugging (others)”.
 <Compilation debug = true / false > ie Debug and Release.
In terms of performance which one is better? Ans: In the application itself we have bin folder. In Debug mode dll size is more and release mode dll is small.

Use Release mode in production as it removes breakpoints and dll size is less.

 What is viewstate?
 Can we write nested try catch blocks?
           we can write n number of catch blocks for a single try block. If errors occurs  

            only the related catch executes.

 Can we compare two dates in Asp.net? How?  Which control to use?  Eg: RegularExpression validator.  Don’t use Comparevalidator control (it is for string,int)
Repeater control
What do you know XML?
Diff b/w custom controls and user controls
Diff b/w Stored Procedure and function
select * from functionname …….. Can we write like this if the function is returning some table. Ans : Yes .
What are table valued, scalar valued functions.. Diff functions in Sqlserver
How do u execute Scalar Valued and table Valued functions in Sqlserver
Ans : select * from fucntionname …. (Table Valued function .. It returns table)

           Exec function functionname   .. (Scalar valued function .. It returns single value)

 

 

Gujarat Ahmedabad company

1.      How to provide pagination in Datagrid? Ans: AllowPaging = true ..Event(PageIndexChanging) to be written in codebehind.

2.      DBCC commands

3.      Viewstate . How they implemented ? Ans : Hidden value

       It is specific to the page

       What is the difference between ViewState and Hidden Values. 

4.      Sql Profiler

5.      What are views? Security

Read Only Views

If we change any value in view will it effect the backend table?

6.      What are Cursors? Types of Cursors?

7.      What is Stored Procedure? Give an example?

8.      How to submit one page information to another?

Session , Cache, QueryString, Cross Page post back

Get Post

9.      What are directives in Asp.net?   Different directives?

10.  Difference b/w Response.Redirect/ Server.Execute and Server.Transfer?

11.  What are joins? Types of Joins?

12.  Does C# supports multiple inheritance?

13.  What is an interface?

14.  Difference b/w interface and abstract class?

15.  What is a webservice?

16.  What is the formatting protocol used in Webservices ? Ans: SOAP

17.  Which one of the following is used in Webservices  – DataReader / DataSet/DataList    Ans: DataSet

18.  What is the difference b/w function overloading/ overriding?

19.  What is the difference b/w system.string and system.stringbuilder

Mutable .. immutable

20.  Difference b/w System.Int32 and int?

21.  Difference b/w String and string

22.  C# access modifiers

23.  What is normalization ? Different types of normalizations ?  Give examples?

24.  What is Denormalization? Why and when to denormalize?

25.  Dotnet features?

26.  Dotnet assemblies and types of assemblies

27.  What is the transmission protocol used in webservices ? Ans: HTTP

28.  What are the differences b/w ASP and ASP.Net?

29.  What is ADO.NET

30.  How many languages supports .Net?

 

INDPRO  (9/9/2006)

 

1.      What are SqlCommand objects methods? What is the difference b/w ExecuteNonQuery and ExecuteScalar?

2.      What is the diff b/w DataRepeater and DataList?

3.      What is the diff b/w Container.DataBind , Eval, Bind

Ans:  Eval for formatting the data like date format

           Bind directly binds and displays the db data as  it is.

4.      What is the diff b/w Array and ArrayList

5.      Difference b/w Hash Table and ArrayList

6.       What are Enumerations , Collections

7.      For raising an event of a control (which is present in usercontrol) where to write the code ( In usercontrol or webform)

8.      Page Life Cycle Events

9.      Mention Application and Sessions events of Global.asax

10.  When viewstate is loaded in  Page Life Cycle (Is it Init or Page Load)

11.   Template column in DataGrid? How hyperlink is used in Asp.net datagrid?

12.  What is the use of webserver controls

13.  Page Directives

 

1.      Diff b/w interface and Abstract  class

2.      What is viewstate and where it is stored

3.      Purpose of FXCOP

4.      What is unmanaged code? How CLR executes Unmanaged code

5.      Write a SP that returns the largest of two numbers

 

 

EMids Technologies Pvt Ltd

1.      In FXCOP can we define our own custom rules? How ?

2.      Diff b/w Sqlserver 2000 and 2005

3.      Equals method comes under {String} class

 

Tostring, Equals,GetHashCode , GetType .. default  methods of an Object

4.      What is the default base class for all classes  Ans: System.Object

5.      Base class for Asp.net pages

6.      Base class for Windows Forms

7.      What is the diff b/w Class and object? Real world example?

8.      Diff b/w HTML Server control and Web server control? What is the base class for these two controls? Can we convert HTML server control to webserver control?

9.      How to call javascript function?  Where we will write the code for calling the function

10.  There is an Employee table. What are the steps involved in populating the datagrid with this table

Employee IDs from 1 to 5000 are there. Without changing the query in the above example fill the datagrid with values Empid < 100

Ans: Use Dataview for filtering the records in dataset

11.  Diff b/w Stored Procedure and function

12.  What are the parameters of SP ? What is the default parameter in SP. Ans: In,Out, INOUT and default is IN

13.  Two textboxes and submit button is there. Which validation control in Asp.net to be used to validate those textboxes. What are the properties to be set in validation controls? Ans: ControlToValidate and ErrorMessage

Without using validation controls how to validate the above things.Any properties are there.? How to validate controls through coding

 

 

FCG (5/12/2006)

1.      Diff b/w Interface and Abstract class? When to use these ?

2.      What is an Assembly

3.      Diff b/w custom and user controls

4.      Diff b/w DataSet and DataReader

5.      Diff b/w DataSet and DataTable

6.      Diff b/w Overloading and Overriding with example codes

7.      What is runtime polymorphism  and compile time polymorphism

8.      What is Static Binding, Dynamic Binding

9.      What is Late and Early Binding

10.  What are the different ways of using NEW operator

11.  What is AS,IS in C#

Ans: AS is for type casting

    IS is for comparing objects

12.  What are Transactions in Sqlserver and in ADO.Net

13.  What are ACID properties?

14.  What are LOCKS. Diff Locks

15.  Concurrency

16.  Isolation levels

17.  Diff b/w Convert.ToString() and ToString()

18.  diff b/w ParseInt and int.Parse() and what is IsParseInt

19.  If two developers are updating data into the same dataset then how the dataset will update the data

20.  What is Biztalk Orchestration?

21.   How to use the webservice to get the document from Document Library in SharePoint

22.  Want to give some permissions to the documents in the document library so that users can see only particular documents. How to achieve this?

23.  What is base class for ASP.Net Page ? Ans: System.Web.UI.Page

24.  System.Object – >  a. GetType

                                b. GetHashCode

                                c. ToString

                                 d. Equals

25.   Types of Polymorphism?

26.  Types of Caching and with example code

27.  Session Management

28.  What are the conditions to use INPROC/OutProc

          InProc …. When we want to work with only one webserver

          OutProc…. When we have multiple webservers

29.  NUNIT, FXCOP . Write unit test cases in NUNIT

30.  C# access specifiers. What is default Access Specifier Ans: Public

31.  Diff b/w internal and Protected Internal

32.  What are Out and Ref parameters in C#

         For out no need to initialize , Ref needs initialization

33.  What is Call By Value and Call By Reference

34.  Specify default base classes for following controls

Control Name
 Base Class
 
WebControls
 System.Web.UI.WebControls
 
HTML Controls
 System.Web.UI.HTMLControls
 
Class
 System.object
 
Form
 System.Windows.Form
 
Asp.Net page
 System.Web.UI.Page
 
Asp.Net WebPart
 System.Web.UI.WebControls.WebPart
 

35.  What is Implicit Type Conversion

Ans: Converts smaller datatype to higher datatype

36.  What is Garbage Collection

In C# explain

What are the namespaces

GC.Collect

Different Periods in GC

37.  How to use these tools

 

NCOVER – Code Coverage

NUNIT  – Unit Testing tool

FXCOP – Code Analysis Tool

NTYPE
NDOC

NANT – deployment scripting tool

 

 

IBS(24/12/2006)

 

1.      What is the use of FileUpload Control? Default file size: 4 MB.Cane we increase the     default file size?

Ans: Yes by using MaxRequestLimit

2.      What is transaction? Ans: Process following ACID rules

3.      When to use interface?Can we overwrite virtual functions? How multiple inheritance is possible in C#?

4.      function overloading is early binding,function overriding is late binding

5.      Diff  b/w XML Serialization & binary serialization.

Ans: XML Serialization – Webservices

         SOAP Serialization for Remoting

6.      How to refresh an aspx page automatically. Ans : by using meta tag

7.      Is clustered index created automatically?                                                                                                                                                         Ans: when we are create primary key on a table.

8.      Diff b/w dispose and finalize?

9.      Diff b/w Web services and Remoting

10.  what is a delegate? what are event delegates?

11.  How to avoid SQL Injection?

 

 

US Technologies

 

1.      Diff b/w interface and abstract class? Can we create an instance for abstract class?

       Ans: http://geekswithblogs.net/mahesh/archive/2006/07/05/84120.aspx

        When to use: In short,

       We can go with a normal class when the class contains the core business logic,if not we can use either abstract class or interface.

        If the base class have some default behavior which applies to all its derived classes the abstract class is to be used.

        If there is no default behavior and every derived has its own implementation then interface is better.

      Some more extra points not covered in the above article:

        In case of interface to implement the methods we use ‘override’key word, But in case of abstract class we use’ virtual’ keyword.
     A class may implement several interfaces but A class may extend only one abstract class.

 

 

2.      How to create a web part and how to place the web part in Share point portal?

3.      How to GAC the dll? What happens when we GAC a DLL? Where the DLL is stored?

4.      What is the use of stored procedure? What happens when a SP is compiled?

5.      Types of Joins.

        Ans: Inner Join, Left Outer Join, Right Outer Join, full join Cross Join, Self Join.

6.      Use of Createchildcontrols and RenderContents methods of web part creation

7.      Bubbling Events:

        Event bubbling is used by the data-bound controls (Repeater, DataList, and DataGrid)

      8.   What is the namespace that is used for sending email?

             Ans: System.Net.Mail

 

      9. How to use user controls in web.config

         <pages>
            <controls>
                 <add tagPrefix=”scottgu” src=”~/Controls/Header.ascx” tagName=”header”/>
                <add tagPrefix=”scottgu” src=”~/Controls/Footer.ascx” tagName=”footer”/>
                <add tagPrefix=”ControlVendor” assembly=”ControlVendorAssembly”/>
           </controls>
         </pages>

          we can use custom controls as well in web.config file

 

 

 

 

Advertisements

.NET Interview Questions Part-X

November 2, 2009

 

Keane India

 

  1. Biztalk

What are functoids ? String functoids, Value functoids

 

  1. Runtime Polymorphism

(or Overloading or Late Binding)

 

       Eg: int function1(int a, int b)

              int function1(float a,float b)

              int function1(int a, int b,int c)

              float function1(int a , int b)

 

  1. What is function overriding?

 

  1. Difference between interface and abstract?

 

  1. Give example for Self Join?

 

 

6.

Employee

EmpId DeptId EmpName
1 1 Emp1
2 1 Emp2
3 2 Emp3
4 2 Emp4
5 2 Emp5
6 2 Emp6

 

 

Department

DeptId DeptName
1 CSE
2 MECH

 

Required Result should appear like the below:

 

DeptId DeptName NumberOfEmployees
1 CSE 2
2 MECH 4

 

Ans:

Select Emp.DeptId, Dept.DeptName, Count(*) As NumberOfEmployees from

Employee Emp inner join Department Dept

On Emp.DeptId = Dept.DeptId

Group by Emp.DeptId, Dept.DeptName

 

 

7.

Department (Master table)

DeptId DeptName
1 CSE
2 MECH

 

Employee (Child Table)

EmpId EmployeeName DeptId
1 Emp1 Null
2 Emp2 Null

 

Can we insert null value in deptid column in Employee table (child table)?

 

Ans : Yes (doubt)

 

8.

 

Employee table : Here EmployeeName has unique constraint

EmpId EmployeeName
1 Emp1
2 Emp2

 

Can we insert a null value for EmployeeName 2 times simultaneously like:

 

Insert into Employee values(3,null)

   … Success

Insert into Employee values(4,null)

   … Failure

Insert into Employee values(5,’’)

  ..Success

Insert into Employee values(6,’’)

   ..Failure

 

 

 

RealSoft Inc. Bangalore

 

  1. Asp.net Caching

 

         Types:

            a. Output (Page)

  1.  
    1.  Fragment
    2. Data

 

 

  1. How values can be maintained in cross paging

Ans: Get,Post,cache, Application variable, Sessionss

 

  1. What are delegates ? Different types? How to create and when to use them?

 

  1. What are custom controls and user controls in Asp.Net

 

Custom Controls have these methods: CreateChildNode(), Render()

UserControls have RaiseEvent() method

 

UserControl Custom Control

 

Will be included in Toolbox framework

 

Can be used in any project

 

5.What are the methods of webparts?

   CreateChildControls, render

 

   What are the controls that are present in Toolbox for Webpart?

   WebPartManager, WebPart Zone etc..

 

   How to debug and deploy a webpart

 

  1. Different UML diagrams

     Ans:Class Diagrams, Sequence Diagrams

 

  1. Xml

 

  1. WebServices

 

  1. Difference b/w Sqlserver 2000 and 2005

 

  1. What are the methods in Ado.net DataView?

Ans: sorting, finding records by using RowFilter

 

10.If we made any modifications in  a dataset then what is the method ?

Ans : Update

How many operations are performed ?

Ans: Only the updated records

If  new records are inserted then how it effects?

 

  1. Different types of css styles

Ans:

  1. page level

<script>

 Function cssfunction()

{

Font: bold;

Sixe: 10;

}

<form>

 

<input type = text class= cssfunction()></input>

</form>

 

2nd Type:

 

In Form2.css we have defined all functions of css

And in Form3.aspx we are using these functions by using link tag

 

Form3

–…

<link href=form2.css >

<script>

 

 

</script>

<form>

 

</form>

 

3rd  Type : Control Level

 

<input type = “text” class = font:bold/>


.NET Interview Questions Part-IX

November 2, 2009

Sharepoint

 

  1. How to customize the site color? Default color given by Microsoft is Blue, how to change the color to red?
  2. How to stop providing delete option when creating a user?
  3. Diff b/w WSS and portal server?

Ans: WSS- created on IIS, SQL server and windows 2003 Operating system

                – Single site

         SPS – Collection of sites (intranet)

–         It is created on IIS,SQL server and windows 2003 Os and on WSS

      Then what is the difference b/w WSS and a web application?

  1. Share point web part namespace and what is the base class for a Share point web part.

Ans: Microsoft.Sharepoint.webpartpages.webpart

  1. How to communicate b/w two web parts?

Ans: IRowConsumer, IRowProvider, Icolumnconsumer, IColumnProvider, Transformer

  1. How did u used Sharepoint web parts and ASP.NET 2.0 web parts?
  2. What is the file name extension for custom web controls? Is it a dll or ascx or aspx?
  3. Sharepoint Object model?
  4. What are the components of Sharepoint object model?

Ans: IIS,Windows server 2003 ,Visual studio, SQL server

10.  What are the databases that are created by Sharepoint?How are they used?

Ans: Portal server name_prof,_site,_server and a config database

11.  Share point installation?

12.  UI layer is present in one server, DAL in one server and BLL in another server, how to communicate b/w them?

13.  Session state will be stored in one server and application in one server, how to link them?

14.  How do u provide security for web parts?

Ans: <trust level=”WSS minimal”> and using safe control

15.  New features in SQL server 2005

16.  Windows authentication in web.config file. What is the internal concept behind their implementation? Hint: Active directory services

17.  What are the basic methods to be overloaded while creating a web part?

Ans: CreateChildControl, Render web part(this method used HTMLTextWriter)

 

 

  1. Two parameters are doing manipulations on the same record of a dataset in .NET. How to prevent accessing the same record simultaneously?
  2. If you want another transaction to happen asynchronously without waiting for the previous transaction to complete, how you can achieve this in .NET?

Tip: Create each transaction in one thread.

  1. ASP.NET roles and membership? What are the default providers?

In Solution explorer 4th tab GUI is Asp.net Membership Configuraion wizard

It will create sps , tables . We can create Users|Roles|Server|Providers. If this GUI is corrupted how you will customize roles and memberships through code?

 

  1. How to deploy windows application in live server?

Ans: Setup and deployment projects and cute FTP

  1. Have you done deployment through wizard?
  2. What is the diff b/w Cache and cookie?
  3. C# 2.0 generics?We can go for overloading then why do we need generics?
  4. what is the namespace that is to be included in .NET for using transactions?
  5. Where the viewstate values are getting populated in the page life cycle?

Ans: LoadViewstate event

10.  How to write code that should identify whether the framework is installed or not?

11.  How to publish a web application in Asp.net 2.0? How to deploy in Live Server?

What are the publishing tools that are provided in Asp.net 2.0? How to customize that deployment process?

 

SQL server

 

  1. Create view syntax?
  2. Complicated query which I had written till now?
  3. Self join?
  4. Types of joins?
  5. If your query performance is getting reduced how to solve the problem?
  6. Uses of cursors?
  7. Types of indexes?
  8. Can we create clustered index on a table which is not having primary key?
  9. Diff b/w SP and function?

10.  Can we create views on multiple tables? If we take insert statement in which table will it show effect?

11.  Diff b/w Union and Union ALL?

12.  Types of authentication in SQL server?

Ans: Mixed and windows

In aspx page connection string initial catalog=”SSPI” is used for windows authentication. Which one is best? Ans: windows authentication because it depends on active directory services

13.  Diff databases are there in SQL servers if you are specifying windows authentication in connection string then can u connect to any database of a SQL server?

Ans: No First you should have permission on the particular database in the SQL server

 

 

Kanexa

 

  1. 4 clients are connected to DB sevrrr.Another client need to connect to SQL server.How to do SQL server registration?

Ans: Add user registration in Enterprise manager

  1. .Net framework, CLR?
  2. Diff b/w ASP and ASP.NET?
  3. Joins, Triggers, DTS?
  4. Interface and abstract class and their real time usage?
  5. Overloading/Overriding
  6. int add(int a,int b)

float add(int a,int b)Is this overloading or overriding?

Ans: Overloading

  1. Exception handling in SQL

Ans: @@error, @@rowcount, sp_addmessage, raiseerror

  1. viewstate,concurrency,transaction

10.  Data grid rendering.How the events are fired in datagrid?(Events sequence)

Ans: Itemdatabound,EditItem,UpdateItem

11.  default base class : System.object

12.   User defined controls and custom web controls

13.  HTMl controls and ASP.NET web controls,if we use runat=”server”  for HTMl controls what happens?

14.  Diff b/w viewstate and control state?

15.  what is auoeventwireup?

16.  Typed dataset and untyped dataset?

17.  Diff b/w drop truncate and delete?

18.  Diff b/w persistent cookie and temporary cookie?

19.  Session storage- inproc,outproc and SQL server

 

 

Proteans

 

  1. In 1.aspx.cs file we have namespace with two classes and two page loads. Is it possible to have two page loads?

Ans: Yes it is possible.

In aspx HTML page source code see the Page Directive

<@Page codebehind = 1.aspx.cs inherits = “Class A”>

So it inherits. You can mention class name. So if you have two page loads also no problem.

 

 Sample Code:

Namespace Project1.Form

{

 

  Public Class A

  {

 

    Public void Page_Load()

    {

 

     }

  }

 

  Public Class B

  {

 

 

     Public void Page_Load()

     {

 

      }

   }

 

}

 

  1. We are having UI code in one server. BLL in one server and DAL layer in another application server. How to link UI layer with BLL layer ?

Ans: Use WebFarm and WebGardening concept

 

  1. What is Composition , Aggregation in UML?

Ans: Suppose

 

Aggregation : HardDisk, Speakers, CPU, Monitor

        Can exists without others. They are independent

Composition: With a record in Invoice an Invoice bill cannot exists.

 

  1. How you implement composition through coding?

 Question : Class B cannot exist without Class A

Class A

{

 

}

Class B

{

 

}

Ans: use nested classes.  Ie Domain, SubDomain

Class A

{

 

Class B

{

 

}

 

}

 

  1. Self Join:

 

Employee : Create table Employee (empid int,  mngid int, empname varchar(50))

EmpId DepId EmpName
1 4 Somu
2 4 Ranjit
3 4 Sreedhar
4 Null Hannan
5 2 Srinivas
6 2 Uppu
7 3 Shanti

 

Expected o/p:

EmpId HeadName EmpName
2 Ranjit Srinivas
2 Ranjit Uppu
3 Sreedhar Shanti
4 Hannan Somu
4 Hannan Ranjit
4 Hannan Sreedhar

 

Then query is :

 

Select a.empid, a.empname as headname , b.empname from employee a join employee b on a.empid = b.depid

 

Expected O/P:

EmpId Headname EmpName
1 Hannan Somu
2 Hannan Ranjit
3 Hannan Sreedhar
5 Ranjit Srinivas
6 Ranjit Uppu
7 Sreedhar Shanti

 

Then Query is:

 

Select a.empid, b.empname as Headname ,a.empname from Employee a join Employee b on a.depid = b.empid


.NET Interview Questions Part-VIII

November 2, 2009

Written Test (Online)

 

  1. Array list
  2. Double/string is value type or reference type?
  3. Namespace for security.

Ans: System.security, System.Runtime.Security, System.netsecurity

  1. If parts of a file & xml is not well formed exception will throw
  2. Valid common mechanism in .NET remoting.

 

Sharepoint Questions

 

  1. What are site groups?
  2. Roles in Share point?
  3. How to provide permissions to the document in the document library?

(so that only the permitted users can access the documents)

  1. CAML queries- what are the two ways of using them?
  2. Diff b/w ASP.NET web parts and Share point web parts?
  3. Default Share point web parts?
  4. How to communicate custom web parts?
  5. Core components in Share point portal server (SPS)?
  6. SPS architecture?

10.  Diff b/w MOSS and WSS?

11.  What makes the SPS as server?

12.  Without hard coding the document library name how to get the documents from all the libraries?

13.  content management server

14.  _Layout purpose?

15.  How to link SQL server and SPS?

16.  What are the tables of SQL server where the data from SPS is stored?

17.  Content placeholder control?

18.  How to place images in portal Server?

19.  How to customize sites in portal server?

20.  Name the default web parts that are present in master page?

21.  Site administrator?

22.  Diff b/w site and sub area?

 

 

Omni Cell:

 

  1. Shadowing VB.NET
  2. Diff b/w function overloading, operator overloading?
  3. In state management what is context?
  4. Diff ways to override – one is abstract what is the other one?
  5. What is virtual method?
  6. Diff C# constructors. When to use static constructors? What is the purpose?
  7. What is polymorphism? Diff ways in C#?
  8. What is partial class? When to use partial class?
  9. What is garbage collection? An object is residing in generation 2 that is a long lived object. From the code u called GC.Finalize () method, what will happen to that object?

10.  How to secure assemblies?

11.  What is default encryption method in .NET?

12.  What is the advantage of delay signing?

13.  Can we use WCF in web application?

14.  Can we use data reader in web service? Ans : NO

15.  What is ASP.NET connection pooling?

16.  What is connection pooling in SQL server?

17.  In web.config, we took <custom errors mode=”On” and we specify the link as error.htm, if error occurs in the application will it display error.html file?

18.  Diff types of triggers in SQL server?

19.  What is the use of instead of trigger?

20.  Diff types of indexes in SQL server?

 

 

Accenture written test

 

  1. Is .NET supports Deterministic destruction?
  2. Thread safe
  3. Lock,Mutex,Signal
  4. What is application domain?
  5. What is stack trace?
  6. 6.      Whether exception raises or not code in the finally block will be executed. True/False – Ans : True
  7. How to use COM + in .NET

Ans: tlbimp, tlbexp

  1. What is a static constructor?
  2. What are MarshalByRef, MarshalByRefObject,TransferBytes

10.  Shadowing concept in C#

 

 

MASCON

 

  1. Diff b/w Interface and abstract class?
  2. Have you ever used enterprise services(COM +) in .NET
  3. In a table .a column gender column is there, while displaying the records instead of M and F Male and Female should be displayed, how to achieve this?
  4. Shadowing

 

 

WIPRO

 

  1. Code access security
  2. How u can return multiple values in C# function in front end and stored procedure in backend? Ans : using out in SP
  3. How to read excel cell from an Excel sheet: Refer Office excel object create instance of work sheet and read the cell
  4. How to read a text file : Ans : File stream

In above two cases performance becomes poor as we are taking large objects. So we        use OLEDB provider concept

  1. private protected modifier in C#
  2. In solution explorer we are having 3 projects, in 3 folders namely- F1,F2 and F3
  3. Default parameter type (value or reference) for a c# function?
  4. How to filter records in dataset? Which method of data view is used?
  5. Use SQLParameter.Add in code behind file instead of writing queries directly(for security reasons)

10.  What is an index? Diff types and differences?

11.  DPAPI is machine dependant used for encrypting connection string .Then 10 clients are connecting to a server so we have to generate DPAPI in all 10 client machines inorder to connect to the server. How to avoid this situation, can you tell me how to avoid this and make use of username and pwd.

12.  User defined data types in DB.

13.  Diff b/w user defined function and stored procedure?

14.  ACID properties

15.  Stored procedure has 2 select stmts and it is returning two result sets, now how to write code in the front end to read the values in 1st and 2nd tables.

Ans: ds.tables [0] and ds.tables [1]

           Ds.MoveNext ()

 

 

 

CapGemini

 

  1. What is delay signing?
  2. How can you achieve ACID properties?
  3. Different locks in SQL server? What is No Lock? How to achieve it? How concurrency is achieved?
  4. 10 class files are there how many assemblies are created?
  5. What is a workflow?
  6. What is overloading, overriding and shadowing?
  7. collections: IList,ArrayList,IDictionary
  8. Methods in arraylist. advantages of using arraylist 

Ans: Add,Insert,Remove,Removeat,AddRange,RemoveRange,SetRange,GetRange etc

  1. Diff b/w Array and arraylist?

10.  How CAS is implemented?

11.   How to write code CheckALL and UnCheckAll code in datagrid? Which events of the datagrid to be implemented?

12.  UML:

  1. What is Multiplicity
  2. What are Composition and Aggregation?How they are different?
  3. Draw UML diagram for a class Class1 implements another class Class2 and how a class extends another class?

 

13. RUP (Rational Unified Process)

     a. Different phases

     b. What is the advantage of RUP?

 

13.  What is XSLT?

 

14.  Purpose of NANT?

 

15.  How to write code in NUNIT for following scenarios?

I clicked on a button that is going to insert a new record in a table which is having a primary key. If I click on the same button for the second time without changing values of the controls it should not insert the duplicate record. How to write code in NUNIT to check this condition?

 

16. What is C# dictionary ? Give syntax and methods provided?

Ans: Dictionary<string,string> dict = new Dictionary<string,string>();

dict .Add(“A”,”Emp1”)

MessageBox.Show(dict(“A”).ToString())

 

Methods of Dictionary:

Add, Remove, Clear, ContainsValue, ContainsKey, Values, Keys,Cast, Item

 

 

17.What is a Static Class?

Ans: It contains only Static Methods

          Private Constructors

         Sealed Class

        It can be initialized using Static Constructor

 

HoneyWell

————–

  1. What are domain controllers?
  2. What is Message Box in Biztalk Server?

Ans : database ( Sqlserver)

  1. What is WebFarm and Clustering?

 

HeuLabs (Singapore)

…………………….

 

Property

PropertyId Name
1 Prop1
2 Prop2

 

User

UserId PropertyId UserName
1 1 User1
2 1 User2
3 2 User3
4 2 User4

 

Write query to get the total number of users for each property?

 

Ans :

Select Count(*) As TotalUsers,  p.PropertyId from Property P

JOIN

User U

ON p.PropertyId = U.PropertyId

GroupBy p.PropertyId

 

2. Select Convert(101, DateColumnName) from Table?

   What is the format in which date is displayed?

 

3Write Singleton Pattern

  1. Delegates
  2. Write code for Datagrid binding.

 

 

Basco Written test

 

  1. Threading

How to sleep, suspend a thread ?

 

  1. How Transactions are handled  in webservices?

 

  1. Isolation Levels in SqlServer?

       Ans: Serializable, Repeatable Read

 

  1. Try Catch Finally

If an exception raises in Try block whether finally is executed or not

If an exception raised in Finally block what will happen?

What type of code is written in Finally block?

 

  1. What is ContentUtil method?

 

 

Microsoft

  1. What is the .NET base class? What are the methods in it? Ans: System. object, Tostring(),GetHashcode()
  2. What is GetHashcode ()?
  3. What is the diff b/w namespace, assembly & class?
  4. What is singleton pattern? Write the code?
  5. What is reflection?
  6. How to load an assembly in runtime? What is the method to load an assembly?
  7. What is metadata?
  8. What does an assembly contains?
  9. What is a manifest? What is the information that contains in an assembly? What are the things that are in assemblyinfo.cs file?

10.  What is attribute? [seriazable]

11.  How to write custom attribute?

12.  What do you about threading?

13.  Diff types of polymorphism? How virtual class is used?

14.  When we compile a CS file what will the system do? What are the steps internally takes place?

Hint: In command prompt CSC compiler is used.

15.  Diff b/w value types (int, struct, stack) and reference types (class, heap)? Who will take care of value type disposition?

 

BASCO Systems Interview

 

  1. What is the difference between autopostback and cross page postback? How to do cross page post back?
  2. What is view state? How it is implemented what is the use of the view state?
  3. What is the use of shared assembly?
  4. Types of authentication in ASP.NET? In which scenario they will be used?
  5. How to implement transactions in back end and front end write the code for it?

 

 

 

  1. How to handle nested transactions in dotnet? Ans: Using System.Transactions
  2. How to write nested stored procedure? How the parameters that should be supplied?

Ans: create procedure proc1

         (

           @param1 int,

           @param2 int,

           @param3 varchar (6)

         )

        As

        Begin

                     Select * from table where id=@param1

                     Exec proc proc2 (@param2)

        End

  1. How to deploy web part? How to create strong name key? What is the file extension of key file Ans: .snk

How to make the web part domain specific i.e. should be used by our own application.

  1. Package & deployment: If previous version is there without going explicitly to control panel add/remove programs then automatically it should be uninstalled and our new version should be installed. How to write the code or what are the options that are available in setup and deployment package & deployment?
  2. Diff b/w ExecuteReader, Execute Scalar and Execute NonQuery?
  3. diff b/w DataReader and DataSet?
  4. How to reflect the changes done in Dataset to Database? Beofre updating what are the adjustments that are to be done in dataset and dataadapter?What are the XML methods of dataset?

      Ans : Dataadapter.Update()

  1. How to execute  a stored procedure in ADO.NET?
  2. Whay WCF is used in place of web services?what is the speciality of WCF? What is the use of proxy class? How to generate it?

10.  What are the diff OOPS concepts? Explain them.

11.  how to implement singleton pattern? What are the different patterns you know?If you are creating n no. of objects what is the method it is called?

12.  How to make a class non inheritable? How to make a class not to instantiate an object?

13.  diff b/w array and arraylist?

14.  what is the use of partial class?

15.  Different types of JIT compilers?

16.  PInvoke means?

 

 

 

Bosch

 

  1. Class A

{

   String name;

   Int cost;

}

     We created  6 objects for this class A a= new A();

                                                                 a.cost=

                                                                  20,10,45,2,56,24

 

      While displaying the cost, records should be in sorted order.

    Ans : Use Icomparable

  1. PInvoke?
  2. Multi threading?
  3. Synchronous calls?
  4. Asynchronous calls?But creating threads for asynchronous calls what are the difficulties we will face?
  5. How to use C++(unmanaged) dlls in .NET?
  6. Database design:

Identify master tables and child tables, normalization and denormalization?

  1. If you are deploying a web application then we have to place aspx pages and dlls in the development server.NET internally uses versioning concept no need of dll registering & unregistering.
  2. Windows application: We have installed exe in 100 desktop machines.If you made some changes in the code is it required to reinstall in all the machines.

Ans: No need. Just place the dlls, how to make the system identify the automatic updations.Ans: write scripts what are the interfaces used

10.  What are themes in ASP.NET 2.0

11.  How to insert single and double quote in Database?

Create table emp(empid int,empname varchar(100))

Insert into emp values(1,’emp1’)

Insert into demp values(2,’emp1’’s’)— two single quotes

Insert into emp values(3, ‘ ur’’s state is “AndhraPradesh”’)

 

O/P:

EmpId empName
1 Sreedhar
2 Emp1’s
3 Ur’s state is “andhrapradesh”

 

12.  Diff types of exceptions u handled in ASP.NET in try catch finally blocks?

Ans: Arithmetic exception

        Invalid cast exception

 

 

 

 

 

 

 

 

 

 

 


.NET Interview questions Part- VII

October 31, 2009
  1. what is the DLL that is used to run the ASP.NET file?
  2. How to convert private assembly into shared assembly?
  3. Difference between where and having clause?
  4. How the data is submitted from one page to another page?- Querystring,Response.Redirect,Server.Transfer
  5. CTS rules
  6. what are the default methods of a class – Tostring(),Equals(),GetHashCode(),GetValueType() – all this is derived from System.Object
 
 ACS:
 
  1. Difference between Interface and abstract class?
  2. what is inheritance?
  3. what is polymorphism? -operator overloading
  4. What are scalar functions and aggregate funcion?
  5. what are ACID rules?
  6. How to populate a datagrid from a combobox,what all the properties and events of the combox that are used- Selectedindexchanged
  7. How to populate a combobox
  8. how to declare a delegate?Types of delegates?
 
 
TCS Bombay:

.Net Interview Questions Part IV

October 25, 2009

TCS Mumbai

—————-

  1. Locks
  2. Concurrency
  3. Error handling in Sql server 

      @@Rowcount , @@Error

  1. Error handling in .Net
  2. How to pass parameters in stored procedures

     IN , OUT parameters

  1. create proc sp_nam( @a1 IN, @a1 OUT)

     Can we used the same parameter name as input and output.?

  1. Can we configure the Server of our application with 2 different versions of      

     Asp.net

  1. What is Polymorphism?
  2. In function overloading can we  write as below:

 

  i. functionname(int a1)

         samefunctionname(float a1)

      ii. function(int a1)

          samefunction(int a1,int b1)

 

  1. Can we remove global.asax file from our application?
  2. What is the use of global.asax file
  3. What are the events in global.asax file
  4. Can we have more than 2 machine.config files in IIS servers?

Can we install 2 IIS versions in one system?

  1.  what is the use of web.config and machine.config files? What is the difference between these 2 files?
  2. What is the difference between HTML server control and Web Server control?
  3. Say something about Datagrid? What is the use of Bound Columns? We gave AutoGenerateColumns = True and we have 3 BoundColumns out of 5 columns. How many columns are displayed in the grid? Ans: 5
  4.  What is the use of autogenerate columns?
  5. Which one is better DataReader/DataSet in terms of performance?
  6.  Can we pass null values to stored procedures?
  7.  Difference b/w Order BY and GROUP BY in SQL?
  8. How to submit one page information to another? Which methods are used? Ans: POST and GET 

POST  : Request.Form

GET :    Request.QueryString

 

If we are using Request then what is the default method it takes?

Ans : QueryString (doubt)

  1. Difference b/w Response.Redirect and Server.Transfer?

Ans:

  1. Can we connect 2 different databases of Sqlserver to our application? How to connect?
  2. Can we connect oracle and sqlserver at the same time?
  3. In web.config  <errors mode=Debug ,none,remote
  4. In web.config <trace  mode = verbose, none
  5. In web.config <sessionstate mode=sqlserver , stateserver inproc,outproc,stateserver
  6. How to debug javascript function in frontend?  Ans: IE -> Tools -> Internet Options-> Advanced ->Uncheck  “Disable Script Debugging (IE)” and “Disable Script Debugging (others)”.
  7.  <Compilation debug = true / false > ie Debug and Release.

In terms of performance which one is better? Ans: In the application itself we have bin folder. In Debug mode dll size is more and release mode dll is small.

Use Release mode in production as it removes breakpoints and dll size is less.

  1.  What is viewstate?
  2.  Can we write nested try catch blocks?

           we can write n number of catch blocks for a single try block. If errors occurs  

            only the related catch executes.

  1.  Can we compare two dates in Asp.net? How?  Which control to use?  Eg: RegularExpression validator.  Don’t use Comparevalidator control (it is for string,int)
  2. Repeater control
  3. What do you know XML?
  4. Diff b/w custom controls and user controls
  5. Diff b/w Stored Procedure and function
  6. select * from functionname …….. Can we write like this if the function is returning some table. Ans : Yes .
  7. What are table valued, scalar valued functions.. Diff functions in Sqlserver
  8. How do u execute Scalar Valued and table Valued functions in Sqlserver

Ans : select * from fucntionname …. (Table Valued function .. It returns table)

           Exec function functionname   .. (Scalar valued function .. It returns single value)

 

 

Gujarat Ahmedabad company

  1. How to provide pagination in Datagrid? Ans: AllowPaging = true ..Event(PageIndexChanged) to be written in codebehind.
  2. DBCC commands
  3. Viewstate . How they implemented ? Ans : Hidden value

       It is specific to the page

       What is the difference between ViewState and Hidden Values. 

  1. Sql Profiler
  2. What are views? Security

Read Only Views

If we change any value in view will it effect the backend table?

  1. What are Cursors? Types of Cursors?
  2. What is Stored Procedure? Give an example?
  3. How to submit one page information to another?

Session , Cache, QueryString, Cross Page post back

Get Post

  1. What are directives in Asp.net?   Different directives?

10.  Difference b/w Response.Redirect/ Server.Execute and Server.Transfer?

11.  What are joins? Types of Joins?

12.  Does C# supports multiple inheritance?

13.  What is an interface?

14.  Difference b/w interface and abstract class?

15.  What is a webservice?

16.  What is the formatting protocol used in Webservices ? Ans: SOAP

17.  Which one of the following is used in Webservices  – DataReader / DataSet/DataList    Ans: DataSet

18.  What is the difference b/w function overloading/ overriding?

19.  What is the difference b/w system.string and system.stringbuilder

Mutable .. immutable

20.  Difference b/w System.Int32 and int?

21.  Difference b/w String and string

22.  C# access modifiers

23.  What is normalization ? Different types of normalizations ?  Give examples?

24.  What is Denormalization? Why and when to denormalize?

25.  Dotnet features?

26.  Dotnet assemblies and types of assemblies

27.  What is the transmission protocol used in webservices ? Ans: HTTP

28.  What are the differences b/w ASP and ASP.Net?

29.  What is ADO.NET

30.  How many languages supports .Net?

 

INDPRO  (9/9/2006)

 

  1. What are SqlCommand objects methods? What is the difference b/w ExecuteNonQuery and ExecuteScalar?
  2. What is the diff b/w DataRepeater and DataList?
  3. What is the diff b/w Container.DataBind , Eval, Bind

Ans:  Eval for formatting the data like date format

           Bind directly binds and displays the db data as  it is.

  1. What is the diff b/w Array and ArrayList
  2. Difference b/w Hash Table and ArrayList
  3.  What are Enumerations , Collections
  4. For raising an event of a control (which is present in usercontrol) where to write the code ( In usercontrol or webform)
  5. Page Life Cycle Events
  6. Mention Application and Sessions events of Global.asax

10.  When viewstate is loaded in  Page Life Cycle (Is it Init or Page Load)

11.   Template column in DataGrid? How hyperlink is used in Asp.net datagrid?

12.  What is the use of webserver controls

13.  Page Directives

  1. Diff b/w interface and Abstract  class
  2. What is viewstate and where it is stored
  3. Purpose of FXCOP
  4. What is unmanaged code? How CLR executes Unmanaged code
  5. Write a SP that returns the largest of two numbers

 

 

EMids Technologies Pvt Ltd

  1. In FXCOP can we define our own custom rules? How ?
  2. Diff b/w Sqlserver 2000 and 2005
  3. Equals method comes under {String} class

 

Tostring, Equals,GetHashCode , GetType .. default  methods of an Object

  1. What is the default base class for all classes  Ans: System.Object
  2. Base class for Asp.net pages
  3. Base class for Windows Forms
  4. What is the diff b/w Class and object? Real world example?
  5. Diff b/w HTML Server control and Web server control? What is the base class for these two controls? Can we convert HTML server control to webserver control?
  6. How to call javascript function?  Where we will write the code for calling the function

10.  There is an Employee table. What are the steps involved in populating the datagrid with this table

Employee IDs from 1 to 5000 are there. Without changing the query in the above example fill the datagrid with values Empid < 100

Ans: Use Dataview for filtering the records in dataset

11.  Diff b/w Stored Procedure and function

12.  What are the parameters of SP ? What is the default parameter in SP. Ans: In,Out, INOUT and default is IN

13.  Two textboxes and submit button is there. Which validation control in Asp.net to be used to validate those textboxes. What are the properties to be set in validation controls? Ans: ControlToValidate and ErrorMessage

Without using validation controls how to validate the above things.Any properties are there.? How to validate controls through coding

 

 

FCG (5/12/2006)

  1. Diff b/w Interface and Abstract class? When to use these ?
  2. What is an Assembly
  3. Diff b/w custom and user controls
  4. Diff b/w DataSet and DataReader
  5. Diff b/w DataSet and DataTable
  6. Diff b/w Overloading and Overriding with example codes
  7. What is runtime polymorphism  and compile time polymorphism
  8. What is Static Binding, Dynamic Binding
  9. What is Late and Early Binding

10.  What are the different ways of using NEW operator

11.  What is AS,IS in C#

Ans: AS is for type casting

    IS is for comparing objects

12.  What are Transactions in Sqlserver and in ADO.Net

13.  What are ACID properties?

14.  What are LOCKS. Diff Locks

15.  Concurrency

16.  Isolation levels

17.  Diff b/w Convert.ToString() and ToString()

18.  diff b/w ParseInt and int.Parse() and what is IsParseInt

19.  If two developers are updating data into the same dataset then how the dataset will update the data

20.  What is Biztalk Orchestration?

21.   How to use the webservice to get the document from Document Library in SharePoint

22.  Want to give some permissions to the documents in the document library so that users can see only particular documents. How to achieve this?

23.  What is base class for ASP.Net Page ? Ans: System.Web.UI.Page

24.  System.Object – >  a. GetType

                                b. GetHashCode

                                c. ToString

                                 d. Equals

25.   Types of Polymorphism?

26.  Types of Caching and with example code

27.  Session Management

28.  What are the conditions to use INPROC/OutProc

          InProc …. When we want to work with only one webserver

          OutProc…. When we have multiple webservers

29.  NUNIT, FXCOP . Write unit test cases in NUNIT

30.  C# access specifiers. What is default Access Specifier Ans: Public

31.  Diff b/w internal and Protected Internal

32.  What are Out and Ref parameters in C#

         For out no need to initialize , Ref needs initialization

33.  What is Call By Value and Call By Reference

34.  Specify default base classes for following controls

Control Name Base Class
WebControls System.Web.UI.WebControls
HTML Controls System.Web.UI.HTMLControls
Class System.object
Form System.Windows.Form
Asp.Net page System.Web.UI.Page
Asp.Net WebPart System.Web.UI.WebControls.WebPart

35.  What is Implicit Type Conversion

Ans: Converts smaller datatype to higher datatype

36.  What is Garbage Collection

In C# explain

What are the namespaces

GC.Collect

Different Periods in GC

37.  How to use these tools

 

NCOVER – Code Coverage

NUNIT  – Unit Testing tool

FXCOP – Code Analysis Tool

NTYPE
NDOC

NANT – deployment scripting tool

 

 

IBS(24/12/2006)

 

  1. What is the use of FileUpload Control? Default file size: 4 MB.Cane we increase the     default file size?

Ans: Yes by using MaxRequestLimit

  1. What is transaction? Ans: Process following ACID rules
  2. When to use interface?Can we overwrite virtual functions? How multiple inheritance is possible in C#?
  3. function overloading is early binding,function overriding is late binding
  4. Diff  b/w XML Serialization & binary serialization.

Ans: XML Serialization – Webservices

         SOAP Serialization for Remoting

  1. How to refresh an aspx page automatically. Ans : by using meta tag
  2. Is clustered index created automatically? Ans: when we are create primary key on a table.
  3. Diff b/w dispose and finalize?
  4. Diff b/w Web services and Remoting

10.  what is a delegate? what are event delegates?

11.  How to avoid SQL Injection?

 

 

US Technologies

 

  1. Diff b/w interface and abstract class? Can we create an instance for abstract class?
  2. How to create a web part and how to place the web part in Share point portal?
  3. How to GAC the dll? What happens when we GAC a DLL? Where the DLL is stored?
  4. What is the use of stored procedure? What happens when a SP is compiled?
  5. Types of Joins. Ans: Inner Join, Left Outer Join, Right Outer Join, full join Cross Join, Self Join.
  6. Use of Createchildcontrols and RenderContents methods of web part creation
  7. Bubbling Events

8.   What is the namespace that is used for sending email?


Microsoft .Net Interview questions Part I

September 14, 2009

1. global.asax events :  

Ans :  Application_Start

            Application_BeginRequest

            Application_EndRequest

          Application_Error

           Session_Start

          Session_End

 

2. Web.Config  :

3. Injection

4. Types of Stored Procedures

5. Extended SPs

6. SessionLess Cookies

7. Persistent Cookies

8. What are Enumerators, Iterators, Indexers,ArrayLists, HashTables

 HashTable is dictionary

 Iterators, Indexers, Enumerators are cursors

9. Difference between System.Copy.Array and System.Clone?

10. What is serialization? Different Types of Serialization? How they will be related to above question?

11. Different Types of Cursors?