Thursday, April 4, 2013

Thursday, March 21, 2013

oDesk PHP 5 Test Answers

odesk test answer

Question:
Which of the following is not a correct way of printing text in php5?
Ans: echo "Plain text";

Question:
Which of the following is not the correct way of starting a session?
Ans: session_initiate()
                                                                                                                      
Question:
Which of the following functions do you need to implement HTTP Basic Authentication?
Ans: None of the above

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

Question:
Which of the following statements is correct with regard to final and abstract?
Ans: a. An abstract class cannot have final methods

Question:
Which composite data types are supported by php?
Ans: Array

Question:
The default value of register_globals in PHP is:
Ans: Off

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

Question:
Choose the correct statement:
include() includes and evaluates a specific file
Ans: 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:
Ans: 3 hrs

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

Question:
State whether True or False
Paamayim Nekudotayim operator allows access only to the static members of a class?
Ans: True

Question:
Which of the following statements is true with regard to comparisons in PHP5?
Ans: 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?
Ans: function_exists

Question:
What will be the output of the following code?
$a = 0.0;
for ($i = 0; $i < a ="="">
Ans: 1

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

Question:
Which of the following is a not a correct way of commenting in php?
Ans: /#PHP Comment

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

what will be the output?
Ans: 18

Question:
Which of the following is the correct way of specifying default value?
Ans: function GetDiscount($Type = "Special") { . . . }

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

What will be the output on running the script?
Ans: Error message will be printed

Question:
What will be the ouput of the following code?
for ($i = 0; $i < i ="="">
Ans: 0134

Question:
Late PHP versions support remote file accessing for the functions:
include_once()
require_once()
Ans: 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;
Ans: Both of them

Question:
Which of the following does not represent logical AND operator in PHP?
Ans: &amp

Question:
Which of the following is not true for a persistent connection?
Ans: These can't be converted to non-persistent connections

Question:
Which of the following are invalid data types in PHP?
Ans: 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();
???
Ans:?>

Which of the following should replace '???' to obtain the value of printName() function?
Ans: $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?
Ans: public function getName(){}

Question:
Which of the following variable declarations within a class is invalid in PHP5?
Ans: var $term =3;
Question:
What will be the output of following code?
$arr = "a";
$arr[0]="b";
echo $arr;
echo $arr[0];
Ans: bb

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

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

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

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

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

echo $a % 2
* $b;
?>
Ans: 0

Question:
What will be the ouput of the following code?
if (-1)
print "true";
else
print "false";
?>
Ans: true

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

Question:
Consider the following sample code:
$x = 0xFFFE;
$y = 2;
$z = $x && $y;
What will be the value of $z?
Ans: 1

What is true regarding this code?
Ans: setcookie will return true

Question:
Which of the following is not a correct way of printing text in php5?
Ans: echo "Plain text";

Question:
Which of the following is not the correct way of starting a session?
Ans: session_initiate()
                                                                                                                     
Question:
Which of the following functions do you need to implement HTTP Basic Authentication?
Ans: None of the above

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

Question:
Which of the following statements is correct with regard to final and abstract?
Ans: a. An abstract class cannot have final methods

Question:
Which composite data types are supported by php?
 Ans: Array

Question:
The default value of register_globals in PHP is:
Ans: Off

Question:
Which of the following is not a valid PHP connection status?
 Ans: 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:
State whether True or False
Paamayim Nekudotayim operator allows access only to the static members of a class?
Ans: True

Question:
Which of the following statements is true with regard to comparisons in PHP5?
Ans: 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?
Ans: function_exists


Question:
Which of the following is the correct way of specifying default value?
Ans: 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?
Ans: Error message will be printed

Question:
What will be the ouput of the following code?
for ($i = 0; $i < i ="="">
Ans: 0134

Question:
Late PHP versions support remote file accessing for the functions:
include_once()
require_once()
Ans: 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;
Ans: Both of them

Question:
Which of the following is not true for a persistent connection?
Ans: These can't be converted to non-persistent connections

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

Which of the following should replace '???' to obtain the value of printName() function?
Ans: $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?
Ans:  public function getName(){}

Question:
Which of the following variable declarations within a class is invalid in PHP5?
Ans: var $term =3;


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





Question:
What will be the ouput of the following code?
if (-1)
print "true";
else
print "false";
?>
Ans: true

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

Question.
which of the following are used for code reuse?
Ans: B,D

:

Question.
Which one of the following is turnary operator?
Ans: D

Question.
What is the result of the following Exprssion?
5+2*4+6
Ans: B

Question.
The default value of register global in PHP is:
Ans: A

Question.
What would b the outpur of the following code?
$string = 'good day';
$string = ucword($string);
echo $string;
?>
Ans: C

Question.
If you want to pass a value to a function by reference, the correct way is:
Ans: D

Question1:
What will be the result of following operation?
Ans: print 4<< 5;
c.     120      

Question
You wrote following script to check for the right category:
1        2        $cate=5;
3        ...
4        ...
5      
6        if ($cate==5)
7        {
8        ?>
9          Correct category!
10        11        } else {
12        ?>
13          Incorrect category!
14        15        }
16        ?>
What will be the output of the program if value of 'cate' remains 5?
Ans: a. Correct category!      

Question
You need to count the number of parameters given in the URL by a POST operation. The correct way is:
Ans:c. count($_POST);      


Question
If expire parameter of setCookie function is not specified then:
Ans: b.  Cookie will expire with closure of the browser      

Question
Which of the following variable declarations within a class is invalid in PHP5?
Ans: d. protected $name = 'Quantas Private Limited';      

Question
Which of the following statements is not true with regard to abstract classes in php5?
Ans: d.     Abstract method must have method definition and can have optional empty braces following it
       
Question
Which of the following pair have non-associative equal precedence?
Ans: d. &=, |=      

oDesk Joomla 1.5 Test Answers

odesk test answer


1. Question: What is the default super administrator account for Joomla called?
Answer: Administrator

2. Question: Which of the following PHP directives are important to Joomla execution to define an alternate compression library if the standard library is not available?
Answer: extension_dir

3. Question: Which of the following files is archive and contains the actual CB component that you must install into Joomla while downloading CB?
Answer: com_comprofiler

4. Question: Which option will you choose to set the site metadata for the installed website?
Answer: Global Configuration

5. Question: What will happen if we set the SSL enabled option to On?
Answer: This option will make the link from the menu begin with an https://

6. Question: The core editor events apply to plug-ins that provide editor functionality such as TinyMCE or XStandard Lite.
Answer: True

7. Question: Which PHP file does the index.php file load to provide the menu bar to the administrator interface?
Answer: Toolbar.php

8. Question: Which of the given database systems is supported by Joomla?
Answer: Mysql

09. Question: Which of the following is the default editor of Joomla?
Answer: TinyMCE

10. Question: Joomla provides an abstracted method called getEscaped() that returns the escaped string regardless of the target database.
Answer: False

11. Question: From which package are the classes (i.e JSite, JAdministrator and JInstallation) which make up the Joomla CMS application extended?
Answer: Installer

12. Question: What is not true about JoomlaXplorer?
Answer: None of the above

13. Question: Which of the following is a system event?
Answer: OnDisplay

14. Question: Which Joomla file provides the central logic of the template, including any module and component display?
Answer: Index.php

15. Question: When will you use SMTP authentication mail settings?
Answer: When you want to use an internal mail server

16. Question: What do you understand by the type of error?
Answer: It means that STRICT_ALL_TABLES is enabled

17. Question: Which path variable holds the path of the currently executing application?
Answer: All of the above

18. Question: Which user events occur with plug-ins that are installed for the front end of the system?
Answer: Both a and b

19. Question: Which type of positioning elements define a concrete area such as a p, td, div or table in a CSS file?
Answer: Block elements

20. Question: Which of the following files does the “/includes” directory not contain?
Answer: None of the above

21. Question: Which option will you select to install or to add the module to your website?
Answer: C

22. Question: Why does Joomla use templateDetails.xml files?
Answer: All of the above

23. Question: Which of the following events is activated after content rendering is complete for content type plug-ins?
Answer: OnAfterDisplayContent

24. Question: All the Joomla settings are contained within a PHP class called JConfig.
Answer: True

25. Question: In which PHP file is the central configuration data for Joomla contained?
Answer: configuration.php

26. Question: What is not true about the MD5 hash value?
Answer: Each password in Joomla is stored as a MD5 hash value

27. Question: There are two root classes for the Joomla framework: JFactory and JVersion.
Answer: True

28. Question: Which option will you select to find unpublished articles?
Answer: Article manager

29. Question: What do you understand from the following code?
Answer: SQL statement is executed against the Joomla database to find empty data fields

30. Question: Which SEO settings will you activate to make Joomla article URL shown in picture A appear as shown in picture B?
Answer: B

31. Question: In which option are errors, warnings and references logged?
Answer: None of the above

32. Question: Which type of files can media manager not upload?
Answer: None of the above

33. Question: Which among the following switches display the current version of PHP?
Answer: v

34. Question: The Joomap extension uses the style-sheets from the currently selected default template to display the sitemap in the site style.
Answer: True

35. Question: Which type of server technology is used by Joomla?
Answer: All of the above

36. Question: Which of the following is not true about the FrontPage Manager?
Answer: You cannot select your content for the FrontPage from all the contents

37. Question: What happens if the Text Separator Field is left empty while using the breadcrumbs module in the module manager?
Answer: None of the above

38. Question: Which of the following support libraries must you include when you are doing a manual compile of PHP to use with Joomla?
Answer: All of the above

39. Question: What is the role of the template metadata file in the system?
Answer: It contains the basic authorship information

40. Question: The index.php file is a combination of HTML and PHP code.
Answer: True

English Spelling Test (U.S. Version)

odesk test answer


Question:1
Identify the misspelled word in the list below.


            a.         Wierd
            b.         Wired
            c.         Whined
            d.         Willful
Question:2
Choose the correct spelling of the word from the options below.


            a.         Bureaucrasy
            b.         Buroucracy
            c.         Bureaucracy
            d.         Beuraucracy

 Question:3
Complete the following sentence by choosing the correct spelling of the missing word.



The professor made it clear that ___________ would not be tolerated.


            a.         plagiarism
            b.         plagiarizm
            c.         plagerism
            d.         plagiarism
Question:4
Complete the following sentence by choosing the correct spelling of the missing word.



Sally’s nervous __________ left her standing at the altar.


            a.         fiancĂ©
            b.         finance
            c.         feancĂ©
            d.         fience

 Question:5
Choose the correct spelling of the word from the options below.


            a.         Excesive
            b.         Exccesive
            c.         Excessive
            d.         Exceesive 

 Question:6
Identify the misspelled word in the list below.


            a.         Occasion
            b.         Occurrence
            c.         Orangutan
            d.         Opponant


 Question:7
Complete the following sentence by choosing the correct spelling of the missing word.



No one knew what devious experiments the scientist conducted in his ______________ .


            a.         labretory
            b.         laboratary
            c.         laboratory
            d.         labratory

 Question:8
Identify the misspelled word in the list below.


            a.         Sophomore
            b.         Supersede
            c.         Susceptable
            d.         Spontaneous
Question:9

Complete the following sentence by choosing the correct spelling of the missing word.



The judge granted the reluctant witness complete ____________ from prosecution for his part in the crime.


            a.         amnesty
            b.         amnasty
            c.         anmesty
            d.         emnesty
Question:10
Identify the misspelled word in the list below.


            a.         Mischeivous
            b.         Misanthrope
            c.         Mussel
            d.         Malicious
Question:11
Choose the correct spelling of the word from the options below.


            a.         Unanimus
            b.         Unanemous
            c.         Unanimess
            d.         Unanimous
Question:12
Identify the misspelled word in the list below.


            a.         Dexterity
            b.         Desicate
            c.         Dyeing
            d.         Desecrate Question:
Question:13

Complete the following sentence by choosing the correct spelling of the missing word.

After my grandfather was diagnosed with chronic_________, he moved to Arizona.


            a.         Neumonia
            b.         Penumonia
            c.         Pneumonia
            d.         Pnuemonia
Question:14
Choose the correct spelling of the word from the options below.


            a.         Synonymous
            b.         Synonymus
            c.         Synonimous
            d.         Sinonymus
Question:15
Complete the following sentence by choosing the correct spelling of the missing word.



Helen was surprised by the __________ stature of her blind date.


            a.         diminutive
            b.         diminuative
            c.         deminutive
            d.         diminutive

Question:16
Choose the correct spelling of the word from the options below.


            a.         Temperamental
            b.         Tempermental
            c.         Temperamentle
            d.         Temparamental
Question:17
Complete the following sentence by choosing the correct spelling of the missing word.



The church members accused the cult of _______________ practices.



            a.         sacreligious
            b.         sacrelegious
            c.         sacrilegious
            d.         sacrilegious
Question:18
Choose the correct spelling of the word from the options below.


            a.         Pronounciation
            b.         Pronuciation
            c.         Pronuncitation
            d.         Pronunciation
Question:19
Choose the correct spelling of the word from the options below.


            a.         Referense
            b.         Refrence
            c.         Reference
            d.         Referance
Question:20
Complete the following sentence by choosing the correct spelling of the missing word.



The waitress brought me a plate of squid even though I _____________ asked for clams.


            a.         specificaly
            b.         specifically
            c.         specifycally
            d.         specificly
Question:21
Identify the misspelled word in the list below.


            a.         Fluorescent
            b.         Fullfil
            c.         Facsimile
            d.         Fictitious


Question:22
Complete the following sentence by choosing the correct spelling of the missing word.



Sam _________ a successful political campaign.


            a.         orchestraited
            b.         orchestrated
            c.         orchestreated
            d.         orchestrated
Question:23
Complete the following sentence by choosing the correct spelling of the missing word.

Let me tie your mittens to your sleeves so you don't ______________ them.


            a.         loose
            b.         looze
            c.         lose
            d.         louse
Question:24
Choose the correct spelling of the word from the options below.


            a.         Restaureter
            b.         Restaurater
            c.         Restaurateur
            d.         Restourateur
Question:25
Complete the following sentence by choosing the correct spelling of the missing word.



Peter always makes such a _____________ of himself!


            a.         nuisance
            b.         nuisents
            c.         newsanse
            d.         nuisance 
Question:26
Identify the misspelled word in the list below.


            a.         Parallel
            b.         Prevalent
            c.         Prejudice
            d.         Perserverance
Question:27
Choose the correct spelling of the word from the options below.


            a.         Manoeuvar
            b.         Manouver
            c.         Maneuver
            d.         Manuver
Question:28
Choose the correct spelling of the word from the options below.


            a.         Vengeance
            b.         Vengance
            c.         Vengents
            d.         Vengence
Question:29
Choose the correct spelling of the word from the options below.



            a.         Vacuum
            b.         Vaccuum
            c.         Vacumm
            d.         Vaccum
Question:30
Complete the following sentence by choosing the correct spelling of the missing word.



Arthur spent hours admiring the gothic ____________of all those French cathedrals.


            a.         architecture
            b.         arkhitecture
            c.         arcitecture
            d.         arckitecture
Question:31
Identify the misspelled word in the list below.


            a.         Councelor
            b.         Condescend
            c.         Camouflage
            d.         Criticize
Question:32
Complete the following sentence by choosing the correct spelling of the missing word.



On the ____________ day of Christmas, Lucy was annoyed to find her yard full of noisy drummers drumming.


            a.         twelvth
            b.         twelfth
            c.         twelfeth
            d.         twelth
Question:33
Identify the misspelled word in the list below.


            a.         Rhythmical
            b.         Reminiscence
            c.         Rheumatism
            d.         Resevoir
Question:34
Choose the correct spelling of the word from the options below.


            a.         Gauge
            b.         Gaje
            c.         Guage
            d.         Gaige  
Question:35
Complete the following sentence by choosing the correct spelling of the missing word.



The annual _____________ was ruined when a family of bears stole all the hotdogs.


            a.         barbecue
            b.         barbequeue
            c.         barbycue
            d.         barbcue
Question:36
Complete the following sentence by choosing the correct spelling of the missing word.



Hazel Dormouse is a _________ creature.


            a.         nocternal
            b.         nocturnal
            c.         noctarnal
            d.         nocturnal 
Question:
Question:37
 Choose the correct spelling of the word from the options below.


            a.         Adress
            b.         Addrress
            c.         Addres
            d.         Address
Question:38
Choose the correct spelling of the word from the options below.


            a.         Reminiscience
            b.         Reminiscence
            c.         Reminescence
            d.         Reminisense
Question:39
Complete the following sentence by choosing the correct spelling of the missing word.



Emma has always been fascinated by the way the mind works, so she’s decided to get a degree in __________.


            a.         pshycology
            b.         psycology
            c.         psyhcology
            d.         psychology
Question:40
Choose the correct spelling of the word from the options below.


            a.         Idiosyncracy
            b.         Idiosincrasy
            c.         Idiosyncrasy
            d.         Ideosyncracy