We have a web developer position1) to fill at CosmoCode and my task is to check possible candidates for their web skills. What I came up with, and what seems to work quite well, is a simple test. I show the candidate the following code and ask them to point out errors.
My rationale is this: any half decent PHP programmer will come up with quite a few obvious errors. But the better candidates will not only find those obvious flaws but will also point out non fatal errors and bad style. Those are the ones we're looking for. Unfortunately the market is very bad currently.
Anyway, give the code a try. What mistakes can you spot? Let me know in the comments
.
<html>
<head>
<style>
body {
font: "Times New Roman";
}
</style>
</head>
<body>
<?
$roles[andi] = "Developer";
$roles[detlef] = "Boss";
?>
<img src="logo.gif" align=left>
<H1>Hello <?= $roles[$_GET['user']]?>!</H1>
<?
$list = new Array();
$list[] = "Apple";
$list[] = "Peach":
$list[] = "Orange";
for(i=0; i<count($list); i++){
echo "<li><b><i>".$list[$i]."</b></i>";
}
?>
</body>
</html>
To really test your self, try to find the errors before looking at the comments
This is the personal web site of Andreas Gohr
- human being, blogger and web geek from Berlin, Germany.
This page was last updated at
2008/06/30 23:16.
Imprint/Impressum
Tagged at del.icio.us:
No tags, yet. Why don't you bookmark it?
Most popular:
Recent readers:
short opening tag
$roles not initialized as array
missing quotes
<img>-Tag not closed, missing quotes @ align (is align attribute xhtml1.0 strict conform?)
<H1> should be <h1>
no evaluation of $_GET-data
there is no Array class in php
missing $-signs, calls count() every iteration, foreach looks better
missing </li>
</b></i> should be </i></b>
shouldn't we use <strong> and <em> instead of <b> and <i>?
did i get everything? :o