Wednesday, October 03, 2007

testing new developers (PHP, OO)

Add to Delicious Digg this links to this post -

It has been a real challenge in the past to find PHP developers with solid Object Oriented programming skills. I have come up with a test, which I think is pretty good at spotting potential weaknesses:

TEST:
Brief: we need a parser which will replace a list of keywords in the following text with links:
‘welcome to my testing page. My <strong>website</strong> is about advanced Object Oriented Programming in PHP, and provides <a href="”/guidelines”" title="”guidelines”">guidelines</a> about how to become an expert in this area. I would recommend you to read “PHP 5 Objects, Patterns and Practice” before <span title="”guidelines”">browsing</span> further the guidelines section. This will give you all the basics you need to know before moving to more advanced techniques.’

Keyword 1: “my website” => replace with “<a href="”/link1.html”">my website</a>"
Keyword 2: “guidelines” => replace with “<a href="”/guidelines-home.html”">guidelines</a>"

Rules:
1) Case insensitive (‘test’ => ‘<a href="”test.html”">test</a>’) implies that ‘Test’ should be converted to ‘<a href="”test.html”">Test</a>
2) If the keyword is already linked to a page, should not be parsed and converted to a new link
3) Remove html within the <a> tag

Requirements:
1) This can be coded using PHP4 or PHP5 syntax, but using object oriented approach
2) We will take into account:
a. Well commented code (with no typo errors)
b. Proper use of errors handling
c. Code structure
d. Proper use of regular expressions
e. Good use of inheritance: the class parser should be as generic as possible, and specific rules should be implemented using extension of the main class Parser for instance.
f. Good use of design patterns
g. Set of rules is incomplete: suggestions for new rules will be appreciated (example: only parse text, not tags attributes)

Extra: Ability to configure replacements – an interface should allow user to add/delete/modify keywords and links, and store the list of keywords and related links into the database (or text file), which are then retrieved by the parser.

let me know what you think?

Labels: , , ,