Please answer the mentioned interview questions. [Resolved]

Posted by Karthik2010_Mca under Interview Questions on 3/28/2013 | Points: 10 | Views : 1294 | Status : [Member] | Replies : 4
Hi,

Can any one update the below mentioned interview questions. plz.

1. We will say that a triple in a string is a char appearing three times in a row.
Return the number of triple in the given string. The triple may overlap. (system task)
CountTriple("abcxxxabc")->1
CountTriple("xxxabyyyycd")->3
CountTriple("a")->0

2. In a page I have 10 asp controls, I want refresh only 5 asp particular controls(the 5 controls it contain tabs). How it is possible using Ajax?
3. In a static class How many constructors is there?

4.
table1
Emp_Id Salary
1 5000
2 6000
3 4000

table2
Emp_Id Dept
1 IT
2 Bpo
3 Testing

I want update the table1 column salary > 5000 and add +500 in table2 IT dept only.

O/p
Emp_Id Salary
1 5500
2 6000
3 4000

Karthik


Responses

Posted by: Jayakumars on: 3/28/2013 [Member] [MVP] Bronze | Points: 50

Up
0
Down

Resolved
hi
karthik
I Resolved this one

4.
table1
Emp_Id Salary
1 5000
2 6000
3 4000

table2
Emp_Id Dept
1 IT
2 Bpo
3 Testing

I want update the table1 column salary > 5000 and add +500 in table2 IT dept only.

O/p
Emp_Id Salary
1 5500
2 6000
3 4000

Answer Query
=======================
UPDATE Table_3 SET Salary =Salary+500 WHERE Salary>500 AND Emp_id=
(SELECT Empid from Table_3 t1,Table_4 t2 WHERE t1.Emp_Id=t2.EmpId AND Drpt='IT')





Mark as Answer if its helpful to you

Karthik2010_Mca, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja_89 on: 3/28/2013 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hai
The answer for 3 rd question is minimum 1

Karthik2010_Mca, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 3/28/2013 [Member] [MVP] Bronze | Points: 50

Up
0
Down

Resolved
hi

refer this
http://stackoverflow.com/questions/490661/how-many-constructors-should-a-class-have

Mark as Answer if its helpful to you

Karthik2010_Mca, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Murugavelmsc on: 3/28/2013 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi,

Answer for 2nd questions:

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">

<ContentTemplate>

<asp:Button ID="btnClick1" runat="server" OnClick="btnClick1_Click" Text="Click- Parent UpdatePanel" />

<asp:Label ID="lblTime1" runat="server" Text="Label"></asp:Label>

<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">

<ContentTemplate>

<div>

<asp:Button ID="btnClick2" runat="server" OnClick="btnClick2_Click" Text="Click- Nested UpdatePanel" />

<asp:Label ID="lblTime2" runat="server" Text="Label"></asp:Label>

</div>

</ContentTemplate>

</asp:UpdatePanel>

</ContentTemplate>

</asp:UpdatePanel>



CodeBehind

protected void Page_Load(object sender, EventArgs e)

{

lblTime1.Text = "Refreshed on:" + DateTime.Now.ToString();

lblTime2.Text = "Refreshed on:" + DateTime.Now.ToString();

}

protected void btnClick1_Click(object sender, EventArgs e)

{





}

protected void btnClick2_Click(object sender, EventArgs e)

{



}


Regards,
Murugavel S
murugavel.sadagopan@gmail.com
http://murugavelmsc.blogspot.in/

Karthik2010_Mca, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response