Deloittte Interview Questions on .. Net {3+yrs experienced}




Answers were Sorted based on User's Feedback



Answer / swapna

HI friends recently i faced Deloitte Interview.

Some questions i remember .Hope these can be useful to u

1)Types of Session state mode?

2)In which database sql server session will be stored?

Deloitte Placement Papers | Deloitte Interview Procedure |
Deloitte Aptitude Questions | Deloitte Technical Questions |
Deloitte Interview Questions


3)How to call javascript from c# code under button_click without using
Button1.Attributes.Is there any method?

4)How to call javascript function from webform1 to webform2?

5)Webserver controls and Html controls differences?

6)CCW,RCW why to use com components when we can manage everything with dlls?

Deloitte Placement Papers | Deloitte Interview Procedure |
Deloitte Aptitude Questions | Deloitte Technical Questions |
Deloitte Interview Questions

7)View state how u make that so that view state in page can not be tampered?

8)which session state mode you used in your current project?why?

9)Diffrences between UDF and Stored procedures?

10)Have you used Application Management Blocks?

11)Difference between temporary table and derived table?

12)If we try to load the data in database if error occurs that should be
displayed when we click button through javascript?


Deloitte Placement Papers | Deloitte Interview Procedure |
Deloitte Aptitude Questions | Deloitte Technical Questions |
Deloitte Interview Questions

Is This Answer Correct ?    51 Yes 5 No

Answer / dhanunjaya g

Answers :

1)Types of Session state mode?

Ans>

InProc mode, which stores session state in memory on the Web
server. This is the default.

StateServer mode, which stores session state in a separate
process called the ASP.NET state service. This ensures that
session state is preserved if the Web application is
restarted and also makes session state available to multiple
Web servers in a Web farm.

SQLServer mode stores session state in a SQL Server
database. This ensures that session state is preserved if
the Web application is restarted and also makes session
state available to multiple Web servers in a Web farm.

Custom mode, which enables you to specify a custom storage
provider.

Off mode, which disables session state.


2)In which database sql server session will be stored?


Ans>session state is stored in the tempdb database of SQL
Server.


3)How to call javascript from c# code under button_click
without using
Button1.Attributes.Is there any method?

Ans>
string strsql = "<Script language = 'javascript'> lovechild
=
window.open('Default.aspx','','width:150px,resizable=no,scroolbar=no'
) ; </Script> ";
this.Response.Write(strsql);

4)How to call javascript function from webform1 to webform2?
Ans>
Using Submit Form Method :
You can submit the form in Webform1.aspx to webform2.aspx.
In that case,
you can retrieve all the WebForm1's form element from webform2.
What we will do in the below example is to add another form
( not a server side one)
which will have two HTML controls;
the first is an submit control the second is a hidden
field which will have the value of TextBox1 web server
control to be posted to webform2

Ex: now the HTML code of webform1 will look like below

<form id="Form1" method="post" runat="server">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</form>
<form name="SubmittedForm" action="WebForm2.aspx"
method="post">
<input id="Submit1" type="submit" value="submit"
onclick="CopyTextToHiddenField()" />
<input name="Hidden1" type="hidden" />
</form>

Of course you realized the we handled the onclick event of
the submit button which will
call a javascript function to copy the value of TextBox1
into the hidden field (Hidden1) in order to post it to
webform2.
Also you so in the second form tag the action attribute in
which we specified to which
page the second form (SubmittedForm) will be posted.

Add the below javascript code
inside the <head> tag of WebForm1

<script language="javascript">
function CopyTextToHiddenField()
{
var textbox1Value =
document.getElementById("<%=TextBox1.ClientID%>").value;

document.forms[1].document.getElementById("Hidden1").value =
textbox1Value;
}
</script>

Now you retrieve the value of
"Hidden1" hidden field in webform 2 using the below code


Response.Write(Request.Form["Hidden1"]);



5)Webserver controls and Html controls differences?

U can get more difference here
http://www.dotnetspider.com/forum/19765-Difference-between-web-control-server-control-Html-control.aspx


6)CCW,RCW why to use com components when we can manage
everything with dlls?

ans> We can't manage Everthing with dlls .becz few problems
will face when handling with dlls
Forex: DLL hell and etc .
so,
A .NET component, however, is a pre-compiled class module
with a .DLL (dynamically-linked library) extension.
At run time, a .NET component is invoked and loaded into
memory to be used by some consumer application.

you may have a single DLL that supports error handling in
your applications. In this case,
the DLL exposes a single ErrorHandler class that performs
all of the error handling required by consumer applications.

So,.Net Components can't communicate with Com directly,so
we can do using RCW (Runtime callable Wrapper) and CCW .


7)View state how u make that so that view state in page can
not be tampered?
Ans>
Administrator wants to make a security check that no one has
tampered with ViewState, how can we ensure this?
Microsoft has provided two mechanisms for increasing the
security of ViewState.
a) Machine Authentication Check (MAC) - tamper-proofing <%@
Page EnableViewStateMac="true"%>
b) Encrypting the ViewState This encryption can only be
applied at the machine.config level, as follows: <machineKey
validation='3Des' />



8)which session state mode you used in your current project?why?
ans> it depends on your project . by default InProc mode.

9)Diffrences between UDF and Stored procedures?



1>Procedure can return zero or n values whereas function can
return one value which is mandatory.

2>Procedures can have input,output parameters for it whereas
functions can have only input parameters.

3>Procedure allow select as well as DML statement in it
whereas function allow only select statement in it.

4>Functions can be called from procedure whereas procedures
cannot be called from function.

5>Exception can be handled by try-catch block in a procedure
whereas try-catch block cannot be used in a function.

6>We can go for transaction management in procedure whereas
we can't go in function.

7>Procedures can not be utilized in a select statement
whereas function can be embedded in a select statement.


11)Difference between temporary table and derived table?
Ans)
1>Using temp table you can able insert the value only at
runtime.
derived table you can insert the data anytime and view also
anytime.

2>Explicit Indexing and Constraints are allowed in temp tables.
Explicit Indexing and Constraints are not Applicable In
Derived tables.

Is This Answer Correct ?    36 Yes 6 No

Answer / abhinaw kaushik

3)How to call javascript from c# code under button_click
without using Button1.Attributes.Is there any method?

Ans : Easiest way will be call the javascript function
omClientClick oh button.

e.g.
test.aspx page

<script type="text/javascript">
function something()
{
if(true) //your logic goes here
{
return true
}
else
{
return false
}
}
</script>

<asp:button id="btnHit" runat="server" text="check"
OnClientClick="return something();">


----------------
Q. How to call javascript function from webform1 to webform2?

Ams : Put that javascript in a separate file e.g text.js

refer this src to all your aspx pages.
e.g.
<script type="text/javascript" src="test.ja"></script>

Is This Answer Correct ?    26 Yes 14 No




Answer / nitin

ScriptManager.RegieterStartUpScript("/Identifier","/Script");
Can be used to invoke javascript function from code behind.

Is This Answer Correct ?    7 Yes 0 No

Answer / ramasubbareddy

Quest:How to call javascript from c# code under button_click
without using Button1.Attributes.Is there any method?

Answer: Yes, There is a PageMethod is used to call javascript from code behind
Example:
========

If i need to pass a value from .aspx to C# codebehind
I need to follow this:

Enable pagemethods= true in your script manager
then
write a function :

<script language ="javascript">
function sendvalue()
{
pagemethod.GetValue("Hello this is test");
}

</script>

C# code:
========

[webmethod]
public static void GetValue(string input)
{
Response.Write(input);
}

OUTPUT:
=======
Hello this is test

Note:

always use static otherwise it will not work


If your not clear with the above solution give me a request i will send original code mail me @ reddy_reddymgr@yahoo.co.in

Is This Answer Correct ?    10 Yes 4 No

Answer / sathya

Sample.aspx

function sample()
{

if(true) //Apply any logic here
{
return true;
}
else
{
return false;
}
}

Is This Answer Correct ?    6 Yes 5 No

Answer / santhsoh

santhosh

Is This Answer Correct ?    12 Yes 12 No

Post New Answer



More Placement Papers Interview Questions

wipro placement paper

1 Answers   Wipro,


speak 1min on topic Travelling,memorable moment ,memorable day?

0 Answers   Google, Sitel,


US Technology Placement Paper 19 Feb 2007 - Kerala

2 Answers  


samcys technologies

1 Answers  


I2 PLACEMENT PAPERS ------ I21 placement Paper 1

2 Answers   i2, SK Technologies,


EasyTech placement papers

2 Answers   EasyTech,


placement papers

12 Answers   HSBC,


bhel

3 Answers   Bhel,


Satyam Placement Paper & Interview On - 08 DEC 2006 - Chennai

1 Answers   Satyam,


exilant private ltd

1 Answers   Exilant,


SATYAM WRITTEN TEST

1 Answers   Satyam,


i want the sample placement paper of goldman sachs urgently. please send it to me

0 Answers   SSC, Bank of Baroda,




Categories