PayPal Interview Question for Web Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

<pre lang="" line="1" title="CodeMonkey68078" class="run-this"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Javascript Tabbed Forms</title>
<style>

div.tabs {
font-size: 80%;
font-weight: bold;
}

.label {
background-color: #CCCCCC;
border: none;
}

a.tab {
background-color: #f0f0f0;
border: 1px solid #000000;
border-bottom-width: 0px;
padding: 2px 1em 2px 1em;
text-decoration: none;
}

a.tab, a.tab:visited {
color: #808080;
}

a.tab:hover {
background-color: #d0d0d0;
color: #606060;
}


/*
* note that by default all tab content areas
* have display set to 'none'
*/
div.tabContent {
padding: 4px;
border: 2px solid #000000;
background-color: #CCCCCC;
display: none;
}
</style>

<script>

// this is a bit of a hack here
// just list the tab content divs here
var tabs = ["tab1","tab2"];

function showTab( tab ){

// first make sure all the tabs are hidden
for(i=0; i < tabs.length; i++){
var obj = document.getElementById(tabs[i]);
obj.style.display = "none";

}

// show the tab we're interested in
var obj = document.getElementById(tab);
obj.style.display = "block";
document.forms["myForm2"]["fieldThree"].value = document.forms["myForm"]["fieldOne"].value;
}

</script>
</head>

<body>

<h1>Javascript Tabbed Forms</h1>


<hr/>

<div class="tabs">
<a class="tab" onclick="showTab('tab1')">Tab One</a>
<a class="tab" onclick="showTab('tab2')">Tab Two</a>
</div>



<!-- note that for the first tab we need to
manually set the display to visible -->
<div id="tab1" class="tabContent" style="display:block">
<form name="myForm" action="javascript:void();" onSubmit="showTab('tab2')">
<table>
<tr>
<td>Name: </td>
<td><input type="text" name="fieldOne" required /></td>
</tr>
<tr>
<td>Address: </td>
<td><input type="text" name="fieldTwo" required /></td>
</tr>
</table>
<input type="submit" value="Submit">
</form>
</div>

<div id="tab2" class="tabContent">
<form name="myForm2" onSubmit="alert('Form saved successfully!');">
<table>
<tr>
<td>The information you have submitted is: </td>
<td><input class="label" readonly type="text" name="fieldThree"/></td>
</tr>
</table>
<input type="button" value="Back to form" onClick="showTab('tab1');">
<input type="submit" value="Save form">

</form>
</div>

<hr>
</body>
</html>
</pre><pre title="CodeMonkey68078" input="yes">
</pre>

- Anonymous August 03, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

hethteh tht h

- dth h h rh August 15, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

{
//Find unique pair in an array
int[] findPair = {3,7,2,5,6,4,3,5,4};
int length = findPair.length;
List<Integer> myList = new ArrayList<Integer>();

for(int i = 0; i < length; i++){
if(myList.contains(i))
continue;
for(int j = i+1; j < length; j++){
if(myList.contains(j))
continue;
if((findPair[i]+findPair[j]) == 9){
System.out.println("Found Pair " + findPair[i] + ","+ findPair[j]);
myList.add(findPair[i]);
myList.add(findPair[j]);
}

}
}
}

- hs September 07, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

oghpgh

- gop June 09, 2011 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More