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?

Thursday, January 19, 2012

Some basic SEO for a new Employee


Some basic Search engine optimizations for a new blog
SEO, means Search Engine Optimization. If you are looking for a great source of traffic (visitors) then you have to understand SEO. This is the main tip to get highly targeted traffic from search engines like, Google, Yahoo, MSN or AOL.
If you are looking for a topic, where do you find the site? You just go to google and search the topic like, mp3 songs or mp3 downloads. You will get the results of websites which covers that topic. You will get the the top ten recommended sites on the keyword (search term) mp3 music. In the same way, many visitors are still looking for the topics you are writing on your blog. You will get the amount of search traffic in the way search engines are giving you the particular placements. SEO is a method to increase your site’s importance among search engines.
SEO is a much bigger subject to explain in a single article. But I can give you some basic tips to get better rankings in search engines,
Contents
In blogging, new and better articles are the contents and the more you have, the more you will be ranked. The more articles you write, the more pages you will create. But you should focus on quality articles. Having a large number with no quality articles will not help you.
Title and web address
Ask yourself, what would be the main keywords to find your blog? If your site is about “Part time Jobs” then your keywords could be, job, jobs, part time, income, salary etc. Try to add some of the main keywords in the title like, your jobs, Part time income, Jobs for Income etc. You could also add keywords in the web address like, JobsForMe.com, MyPartTimeJob.com, and Income-From-Job.blogspot.com etc. But adding too much keyword might look messy and you might lose rankings.
Post title
If you are writing an article about computers, then these keywords will come on your article like, pc, computer, laptop, cpu etc. Add those key words in the article title like, My favorite PC, Using Dell laptops, Setting up the CPU of my computer etc. These will help you to get better rankings.
Anchor text
This is an example of anchor text, blogspot. I have linked this word, blogspot to one of my articles, start a blog using blogger(blogspot). These way readers can click on it and read that article. By doing this, you are increasing your older article’s rank. The more articles you write, the more pages you create for the blog. Search engines give individual ranks for each pages. By linking your older pages, you are helping your blog to get more rankings.
Backlinks
Backlinks/ Linkbacks are the links which point to your blog from another website. Major search engines like google counts this backlinks and determines the importance of a site. The more backlinks you get, the more ranking you will have. There are many ways to get backlinks. One of the popular method is to ask other bloggers a free link or a link exchange. I will write more about this topic later.
There are more and advanced topics and methods are used in SEO, I will share them later, but now you use these tips and see the difference.
5 Crazy but Natural SEO optimization tricks for your blog
These are some of the crazy but natural SEO optimization methods that we don’t hear a lot but it really works in the long run. So let’s read, learn these crazy but effective SEO tricks.
Keywords in image alter tags
We love to add images on our post, don’t we? Images are labeled as IMAGE1, PICTURE1, PHOTO_1 etc. I have labeled my image acording to what the image represents. This is a cool way to get search traffic even from image search results.
Popular forum and discussions
When you write a new post, add the same post on forums/ popular discussion sites. It’s not spamming, some site allows you to promote your blog posts. Add the post title as the thread title and linkback from the thread. Here you get some traffic from the forum, get a link and additionally these established sites rank higher in different keywords. So where your main article is no where near in the top listing, these forum thread will be there who are linking to your original article.
Social media aggregators
Most people don’t care about aggregators such as friendfeed, peoplepond or facebook. If you post your links on social media such as twitter or digg, it will appear on different aggregators too. The cross linking works well in SEO terms and soon you will get more links pointing to your article as the snowball rolls.
Links on the footer
Most website owners love to put the important page links on the footer section; it’s not only making the site user friendly, but also giving a good SEO boost. The footer appears on all of your blog posts or pages, that means you are getting linked back from all of your pages back to your own site.
Using heading tags
You see when I write posts, I make my whole article into small paragraphs, plus I add a sub title for each of the paragraphs. I do this because I want my reader to feel comfortable while reading short paragraphs. The sub title also gives an idea on what the paragraph is all about. But the main thing is, the sub titles are done with “Heading 2” tag. Search bots take good care of the text inside the heading tags and because I add keywords inside the heading, I get more SEO juice.
What else can be done?
Please tell me what things you do to make your site SEO friendly? For good seo, we get better traffic and can earn more money online; please do share your personal SEO tips and share this post on your favorite site.
Killer guide to get regular backlinks to your blog
As we all know, links are the main currency of the internet. The more backlinks you have, the higher you’ll get ranked. The more sites linking your blog means you’re getting more traffic over time and better page rank.
On this article I’m going to tell you about building even more backlinks to your blog. Links that point to your blog homepage using directories; and the way to build links for internal pages using social bookmarking.
Directory submissions
I think you all know about directories and what they do? Directories are the part of web 1.0, the time when people used to find sites using directories. There are lots of directories on the internet and the more you submit the more traffic you’ll get. Submitting on directories will give you 1 backlink to your site each, so this is a cool way to get more links.
Start by using this cool list called AddUrl.nu. This guy has made a list of almost 1000 SEO friendly directories. Look at the current stat, 989 directories. If you can able to submit your link to all of them that means you’re getting 989 new backlinks to your homepage!


To start submitting, create a notepad file and add your blog URL, title, description and keywords in it ~you’ll need this info on every submission!
Now start the directories one by one and submit your blog.
Faster submission
I know copying the texts may bore you within minutes. Here’s a great tip for firefox users. Go to firefox tools > options > privacy tab and select, ‘Remember what I enter in forms and the search bar
Now after a few submissions, firefox will know what to enter in the form. Just press on the down arrow for each field and you’ll have the data (no need to copy-paste again and agian!)
Reciprocal links?
When you submit your links on the directories, there are few options like a paid listing for $5; free links; free links with reciprocal. A reciprocal means you have to link to their directory to get a link from them.
Now if you link to that directory, they’ll put much more interest in your site and they’ll add your blog into the directory faster. Sometimes you have to give a link before you can get one. It’s not a bad thing to link to those directories.
You can create a new blog page or post with the directory links (the page where you’re putting the reciprocal links) If you’re linking a lot, you can create different pages for this job. My tip is to keep 30-40 links on each page to be on the safe zone.
Social bookmarking
Social bookmarking can help you a lot to get better search rankings and traffic. You can submit your articles to different bookmarking sites that will increase the links of internal pages. This method is old and it requires a lot of effort to submit your post to each of them one by one.
Faster bookmarking
When there’s a will, there’s a way! You want to submit your site to bookarking sites and you want to make it faster; here’s the solution. Go to this site called This site will help you submit your post on 79(till now) social bookmarking sites.
WAIT! This is not an automated submission service! SocialPoster will help you to submit your post hassle free. Just fill out the form with your blog post URL, title, description and keywords,

Now select ‘Frame submit‘ and choose the type of sites. I choose the dofollow option. That means I’ll be submitting the post to sites that share the search rank. Click ‘Start posting
After you click on ‘Start posting‘ ~you’ll be then taken to the sites one by one to submit your article. The site will be inside of the special social poster iFrame (like a toolbar on top) You must have an account on that site to post your link. Here’s the shortcuts that allows you to register, login or post on that page.

After you done the registration and login thing, you can ‘post’ your article and see the magic! The title, URL, Description and other details are filled automatically. You just have to click on the ‘Submit’ button and you’re done! After you’ve submitted your site, click on ‘Next’ to post your article on the next site.
Tell me what do you feel?
Are you trying to build backlinks to your blog? Do you think the methods I shared today will increase your link popularity? Please do promote this page or my blog with the way you love!
Some special notes
Submitting your site to directories won’t give you a backlink instantly. It could take few weeks or month to get listed. To avoid a brain stroke, try to start with small by submitting on 10-20 directories a day.
Social bookmarks are fast and they’ll pass very low SEO values but more hot traffic. It’s better to ask your friends to add your post on social sites.
Learn these Black hat SEO techniques but don’t apply them with your blog
Search engine optimization(SEO) is the science of getting better search results in search engines. But the crazy part is that, no search engines likes google, yahoo or ask tells anyone the ways they rank web pages, blogs and how they put them together on their search page.
We bloggers who spend day and night with search results and searching thousands of keywords, learn by the way they provide each search results. Now we can give a suggestion that, doing this might give you better places in search engine.
There are many ways to increase your search results. The natural way of building backlinks and other methods are the white hat SEO or the good guy way. And the other way is called the black hat SEO or the bad guy way. Black hat SEO is bad because google doesn’t likes this one and might punish you for doing this.
Here are some black hat SEO techniques to learn from but applying them will lead you to, BANNED FROM GOOGLE!

Spamming
Spam are the junk files of internet, some informations which are not worthy. If you spam on blogs and forums to build incoming links, this will be a bad way to build links and when google will find you, they will punish you. Signing up for many accounts in any social platform, creating lots of blogs un-naturally is also called spam. Google has your IP address stored and knows what you are doing online so everything you are doing is effecting your overall reputation.
Link farming
If you start a massive campaign of link exchange to build incoming links to your blog, this will determined as a link farm. Linking to lots of off topic blogs will make your blog a linkfarm and google doesn’t likes link farms. Linking with a link farm, like the link exchanging websites is also a black hat SEO trick.
Traffic exchange websites
The sites which allows you to exchange free traffic and visitors and show unwanted pop ups, are the bad neighborhood. Linking or using traffic exchange sites is a bad guy trick.
Link trading
This is a controversial issue. You may want to pay other sites to show your link for traffic or get paid to link other blogs to make money, just as we do to make money with paid contents. Google doesn’t likes this method of paid links that’s why they punish the sites with paid links. In pro blogging, you will have two options to choose from, get paid from paid content or get a good page rank.
Hidden keywords
Your page will never show on the search results for the term, ‘baseball’ if there is nothing written about it on your blog. Black hat SEO experts create a list of all sort of searchable keywords and place them on their blog. Now they will pick the color of text to match the background so that the keywords will be invisible to humans but it will be accessible to search robots and will get ranks. This is a serious trick and it may ban your site completely from the search engine.
Backdoors
To stay out of trouble, black hat SEO’rs create two websites. One is for the dirty trick and one is the main site. First one is filled with hidden keywords, spam and other tricks to get ranked well in search engines. This page is an opening page and linked to the main website. If this site gets banned, they will stay out of trouble and their main site will be safe. Google has advanced technology to find the backdoors so please don’t try this at your site.
Robot texts
Most of the programmers create special robot texts to spam, build links, get ranks and for other things. Using robot texts to getting better search rankings is a black hat SEO trick and you should not use it.
Who got banned?
Everyday thousands of sites are loosing their ranks, places or even the existence in search engines for using black hat SEO tricks. This method may result a boost but have terrible effects on your blog’s ranks.
JohnChow.com is a big blog and have 25,000 daily RSS readers. John chow had google page rank 6 few years ago and now he has NO page rank. He is banned from google for using black hat SEO tricks and getting lots of un-natural incoming links. If you search the term, ‘John Chow‘ or ‘Make money with john chow‘ -you will never see johnchow.com in the google search.
So my suggestion is to stay out of trouble and use legal methods to get traffic and ranks. Traffic and success has to come automatically, not illegally