Hey guys. I've been maintaining my own PHP/mySQL site for 3 years now and recently applied for a $25/hr - $40/hr job as a LAMP developer. I have an interview tomorrow and am halfway confident. I came across a couple of PHP skill assessments and one I got only 1 wrong out of 20 and it was a silly question.
The 2nd assessment had some questions that I was unsure whether or not they were using typos, etc. to try and trick me or if I'm just not used to seeing this syntax.
I'm copying/pasting the questions and my own answers, although the assessment didn't work so I was hoping some of you could help me out with correcting my answers. I want to make sure I know my stuff for the assessment tomorrow during the interview. I currently earn $8.55/hr as a lifeguard about 20hrs/week and can't afford this any more here in Connecticut. Wish me luck! 🙂
$a .= "a";
$a .= "b";
$a .= "c";
What is the value of $a ? [B]ANSWER: $a = "abc";[/B]
$a = 4;
for ($b = 0; $b <= $a; $b++) {
$c++;
}
What is the value of $c ? [B]ANSWER: 5[/B]
$a[] = "a";
$a[] = "b";
$a[] = "c";
What is the value of $a[2] ? [B]ANSWER: $a[2] = "c";[/B]
$a = 200.5;
$b = 2005;
$c = "2005";
Which of the above variables's type is integrer ? [B]ANSWER: $b = 2005;[/B]
$a = '1';
$b = &$a;
$b = "2$a";
What is the value of $a ? [B]ANSWER: $a = '1';[/B]
$a = "abc";
$b = substr($a, 0, -1);
What is the value of $b ? [B]ANSWER: $b = "ab";[/B]
$a = true;
$b = "true";
$c[] = "true";
Which of the above variables's type is string ? [B]ANSWER: $b = "true";[/B]
$a = "b";
$b = "a";
What is the value of ${$b} ? [B]ANSWER: $b = "a"; Im not familiar with this type of syntax[/B]
$a = array("a","b","c");
foreach ($a as $b){
$c++;
}
What is the value of $c ? [B]ANSWER: $c = "3";[/B]
$a = "0";
$b = "0";
if ($a != "1" && $b == "1" || $a != "0" || $b != "1" ){
$d = "0";
}else{
$d = "1";
}
What is the value of $d ? [B]ANSWER: $d = "0";[/B]
$a = "post_processed_string";
$b = array("post_", "_");
$c = array("", " ");
$d = ucwords(str_replace($b,$c,$a));
What is the value of $d ? [B]ANSWER: $d = "Processed String";
[/B]
$a = "<tt>some</tt><b>html</b>";
preg_match("/<\w?>(\w*?)<\/\w?>/",$a,$b);
What is the value of $b[1] ? [B]ANSWER: NO IDEA, I better study up on preg_match! :)[/B]
Thanks a lot guys. If I can land this job it would be incredible. I could stop going further into debt and have fun doing my job!