Friday, January 20, 2012

oDesk php 5 test answers


What is true regarding this code?


setcookie will return true


Question:
Which of the following is not a correct way of printing text in php5?


echo "Plain text";



Question:
Which of the following is not the correct way of starting a session?


session_initiate()

 Question:
Which of the following functions do you need to implement HTTP Basic Authentication?


None of the above

Question:
Which of the following Command Line Interface constant is not defined in the CLI SAPI?


STDPRT

Question:
Which of the following statements is correct with regard to final and abstract?

a. An abstract class cannot have final methods
Question:
Which composite data types are supported by php?

Array

Question:
The default value of register_globals in PHP is:

Off

Question:
Which of the following is not a valid PHP connection status?

 open

Question:
Choose the correct statement:

include() includes and evaluates a specific file

require_once() includes and evaluates a specific file only if it has not been included before

Question:
If the session_cache_expire() is not set, then by default the session cache will expire after:

3 hrs

Question:
What will be the output of the following script?
$count=50;
function Argument()
{
$count++;
echo $count;
}
Argument();
?>

 It will print 1

Question:
State whether True or False

Paamayim Nekudotayim operator allows access only to the static members of a class?

True

Question:
Which of the following statements is true with regard to comparisons in PHP5?


With (===) operator, object variables are identical if and only if they refer to the same instance of the same class.

Question:
Which of the following built-in function assist in checking if actually the function exists or not?

function_exists

 Question:
What will be the output of the following code?
$a = 0.0;

for ($i = 0; $i < a ="="">

1
Question:
What will be the output of the following code?
$i=4;
$j=30;
$k=0;
$k=$j++/$i++;
echo $i . " " . $j . " " . $k . " ";

5 31 7.5

Question:
Which of the following is a not a correct way of commenting in php?

/#PHP Comment


Question:
Following is a php code block:
$m=9;
$n=99;
$z=8;
$z=$n++/$m++ + --$z;
echo $z;

what will be the output?

18


Question:
Which of the following is the correct way of specifying default value?


function GetDiscount($Type = "Special") { . . . }

Question:
With reference to the following php script:
print 'Text Line1'
print 'Text Line2'
?>

What will be the output on running the script?


Error message will be printed


Question:
What will be the ouput of the following code?

for ($i = 0; $i < i ="="">

0134
Question:
Late PHP versions support remote file accessing for the functions:

include_once()
require_once()
both of them


Question:
You have designed a user login form as follows:

User Name: 
Password: 
How can you access the username entered by the user in the 'Validate.php' webpage?


a. $var= $_POST['username'];
b. $var= $_REQUEST['username'];
c. import_request_variables('p', 'p_');
$var= $p_username;
Both of them



Question:
Which of the following does not represent logical AND operator in PHP?
&amp
Question:
Which of the following is not true for a persistent connection?
These can't be converted to non-persistent connections

Question:
Which of the following are invalid data types in PHP?


char


Question:
The Manager and Office classes are as follows:
class Manager{
function printName() {
echo "Manager";
}
}
class Office{
function getManager() {
return new Manager();
}
}

$ofc = new Office();
???

?>
Which of the following should replace '???' to obtain the value of printName() function?


$ofc->getManager()->printName();

Question:                                                              
The classes are defined as follows:abstract class BaseCls{
protected abstract function getName();
}

class ChildCls extends BaseCls{

}
Which of the following implementations of getName() is invalid in ChildCls?

 public function getName(){}

Question:
Which of the following variable declarations within a class is invalid in PHP5?

var $term =3;
Question:
What will be the output of following code?
$arr = "a";
$arr[0]="b";
echo $arr;
echo $arr[0];


bb

Question:
For the following code:
the output will be:

171

Question:
What is the result of the following expression?
5+2 * 4+6
19

Question:
What will be the output of following code?
$var = 1 + "-1.3e3";
echo $var;

-1299

Question:
What will be the output of following code?
$var1="a";
$$var1="b";
echo "$var1 $a";

a b

Question:What is the output of the following code?
$a = 500;
$b = 200;

echo $a % 2
* $b;
?>

0

Question:
What will be the ouput of the following code?

if (-1)
print "true";
else
print "false";
?>

true


Question:
What will be the output of the following code?
echo 12 . 6;

126

Question:
Consider the following sample code:
$x = 0xFFFE;
$y = 2;
$z = $x && $y;

What will be the value of $z?

SEO Interview Questions

Interview Questions listed below are most commonly asked questions when you be there for SEO profession Interview; it is significant to ponder on how an response is given somewhat than the authentic answer. They often panic interviewees, practice well by reading SEO articles, to get a good opportunity in SEO turf and shine in this industry. Read Interview Tips Given by SEO Experts.
·         Explain your seo Experience?    
·         Is sitemap useful for Seo?
·         Do you know HTML Coading?
·         Did you work on PPC?
·         Can you write HTML code by hand?
·         Explain your see Experience?
·         What Seo tools do you regularly use?
·         Explain importance of meta tags in seo?
·         Have you attended any seo conferences?
·         What is the difference between SEO and SEM?
·         Give me a description of your general SEO experience.
·         What role do social media play in an SEO strategy?
·         Explain what META tags matter in today’s SEO world?
·         What kind of SEO strategies do you normally implement for back links?
·         What do you think is different about working for an SEO agency vs. doing SEO in-house?
·         To what extent do you think seo is effective?
·         As a seo consultant do you consider yourself as creative?
·         Have you ever prepared proposal for seo clients? If yes can you give me one proposal now?
·         What are the problems you face in seo industry?
·         How do you evaluate whether a seo campaign is working?
·         In what area of seo are you strong? And what area of seo you are weak?
·         What seo blogs and Forums do you read?
·         Do you have experience in social media optimization?
·         How far do you think social media optimization help a website to achieve top position in search engines?
·         As a seo consultant what do you prefer Google / yahoo/ bang ?.
·         Do you have Knowledge of Static as well as Dynamic Website Optimization?
·         Do you have experience in copy Writing and can you provide some writing Sample?
·         What is the role of social bookmarking sites in Seo?
·         What do you mean by social networking Traffic? How do they help for website seo?
·         Have you done any Video Submissions and Video Promotions.?
·         Explain what page rank is and explain page rank algorithm?
·         Explain me the steps you follow for optimizing a website?
·         For what clients you have done seo? Are you successful in doing seo for them?
·         What is link building? Link buying?
·         What kind of activities do you normally implement for generating back links for a website?
·         Why do we use no follow on an internal link?
·         What do you mean by competitive analysis and what techniques do you use?
·         How many target keywords should a website have? Or how many target keywords do you suggest for a website?
·         How do you help your client to decide budget allocation for seo and pay-per-click?
·         Do you have your own blogs? Do you do any seo freelance works?
·         How do you handle your client if he does not want to implement your seo recommendations?
·         Could you briefly explain the Page Rank algorithm?  And what do you think of Page Rank?
·         What do you think of using XML sitemaps?
·         Do you have experience in copywriting and can you provide some writing samples?
·         Explain various steps that you would take to optimize a website?
·         Have you ever had something you’ve written reach the front-page of Digg?  Or Stumbled?
·         Why might you want to use no follow on an internal link?
·         What do you think about link buying?
·         What areas do you think are currently the most important in organically ranking a Web Site?
·         Who are the two key people – who started Google?
·         What is the difference between Page Rank and Toolbar Page Rank?