Amazon.com Interview Question
1,572 Interview Reviews |
Back to all Amazon.com Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Development Engineer at Amazon.com:
Given an array of int, find sum of the most common int.
See more for this Amazon.com Software Development Engineer Interview
Helpful Question?
Yes |
No
Inappropriate?



0 of 0 people found this helpful
by needajob:
{
$index = 0;
$highest = $num[0];
while($index != count($num))
{
if($hash[$num[$index]])
$hash[$num[$index]] ++;
else
$hash[$num[$index]] = 1;
if($hash[$num[$index]]>$hash[$highest])
$highest = $num[$index];
$index ++;
}
return $hash[$highest] * $highest;
}