Face an interview with basics

0
Your rating: None

Some days before came across an interview, where in I have to face the basics for Team Leader.

so my friends beware hope you will find this functions useful. Although there are short ways but still some people want to take the same long ways.

Here are the functions :

//Max element of an array

function max_array($array){
$max = $array[0];
for($i=0;$i < count($array);$i++){
if($array[$i] > $max){
$max = $array[$i];
}
}
return $max;
}

//min of an array

function min_array($array){
$min = $array[0];
for($i=0;$i < count($array);$i++){
if($array[$i] < $min){
$min = $array[$i];
}
}
return $min;
}

//sort an array using bubble sort

function array_sort($array){
for($i=0; $i < count($array); $i++){
for($j=0; $j < count($array)-1; $j++){
if($array[$j] > $array[$j+1]){
$temp = $array[$j+1];
$array[$j+1] = $array[$j];
$array[$j] = $temp;
}
}
}
return $array;
}

//check if a string is a palendrom

function check_palendrom($str){
for($i=0;$i < strlen($str)/2;$i++){
if($str[$i] != $str[count($str) - $i -1]){
return "Not palendrom";
}
}
return "Palendrom";
}

 #

So carry on with a fresher team lead ha ha ha ---

 
 #

Company name can't be disclosed, but it's the truth

 
 #

Buddy what is the company name

 

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.

Cumulus Tag Cloud

Kiran Says

SEO Architect,SEO Specialist reflect my values.

By enduring black hat methods the SEO industry is setting itself up for washout and sleepwalking into oblivion.

Jobs in India