PHP / MySQL Testing Job Applicants

Express the business side of your digital lives. Share your experiences and/or your comments regarding a business or organization.

No advertising.

Moderator: General Moderators

PHP / MySQL Testing Job Applicants

Postby Gushy » Tue Jan 24, 2006 5:45 am

I'm currently short listing applicants for a job at my company, and I wanted to give each interviewee a small test to judge their abilities.

I was hoping you guys might have suggestions as to what I could do.

My idea was to set a small test (30 - 60 mins) during the interview from which I would be able to judge what level the interviewee was at (and therefore whether they are worth the cash they are asking for!).

Previously I have only receruited for juniors with no experience so a basic html test was all I needed, but now I'm recruiting for a mid-level (2 years commercial experience) and I already know that the job has attracted applicants with backgrounds from 1 years experience to 5 years. And just because they've got 5 years experience doesn't mean that are worth more / any good.

Should I go with a test where they have to code a solution to a problem, one where they are given a broken system and have to fix it, or one where they are given a working system and they have to implement an improvement?

What things do you think I should / could cover in the test given the timeframe?

It is important that I set something that has multiple solutions so that I can easily differentiate between the good programmers and the great ones.

On a side note if you are in the UK and interested you can see the advert here http://forums.devnetwork.net/viewtopic.php?t=43278
Gushy
Forum Newbie
 
Posts: 7
Joined: Tue Jan 24, 2006 5:32 am

Postby onion2k » Tue Jan 24, 2006 10:59 am

30 - 60 minutes is very little time to implement anything much .. I'd give them a few broken scripts, with errors ranging from the trivial (missing ;s, missing $ signs, input parameters in the wrong order), that sort of thing, and ask them to fix them AND make any improvements if they see an opportunity. Sorts of things like adding input validation to a form, refactoring so the code doesn't rely on globals, etc.

Most important of all though .. allow time after they finish to run through the scripts and discuss WHY they did stuff. That should give you an insight into how they work. For example, for adding validation to a form is it more a case of "Because that's what I was taught" (bad answer), or "Because this change will improve the security of the script and allow us to feed relevant error messages back to the user" (Good answer).

PS. No offence, but that's a horrendous website.
User avatar
onion2k
Jedi Mod
 
Posts: 5263
Joined: Tue Dec 21, 2004 6:03 pm
Location: usrlab.com

Postby Gushy » Tue Jan 24, 2006 11:11 am

yeah the time factor is the big thing. Pretty much the only thing I think I can do is 'fix the broken script' and here's a small form/file input, here's the output, do the script.

I'm now thinking something that'll include string manipulation and the possibilty to code a straight structured file, or a function or class as the interviewee sees fit. Nothing complex, but it's about their approach that'll give me a good insight into them.

I've never had to do a test (luckily) so I have no direct experience of doign this in an interview. A few people have said they've done interviews where they've been given a task before the interview and told to bring their answer.

I kind of like that becauseit can cover a bit more, but at the same time they could just download all the code.

Maybe a combination of the two .... I don't want to be taking the smurf though.

Certainly having time to discuss the test is a great idea, I had planned to interview, test, then review the results later. I like your idea better!
Gushy
Forum Newbie
 
Posts: 7
Joined: Tue Jan 24, 2006 5:32 am

Postby raghavan20 » Thu Jan 26, 2006 7:15 am

When thinking about bad programming practice, I came up with an initial list of the following...bear with me for the non-ordering of all points...

1. Non initialization of variables
2. No proper indentation
3. No proper spacing between expressions
[this is bad: for($i=0;$i<mysql_num_rows($result);$i++);
this is good: for ($i = 0; $i < mysql_num_rows($result); $++)]
4. No proper summarization of the purpose of a function or a member function in a class
5. Not mentioning the inputs and ouputs for any function
6. No proper opening and clocks of if blocks and while loops
7. Inconsistent naming of files
8. Inconsistent naming of functions [get_memberId() or getMemberId(),,,only one of these should be followed all through out the code]
9. Not using proper regular expressions to validate inputs
10. Not working out the logic before trying to implement any functionality
11. Inability to identify reusable components
12. Inability to model real world objects as classes
13. Providing proper public, protected and private access to member variables and member functions
14. Not providing accessor and mutators for getting and setting member variables.
15. Mutators, setters without Boolean return
16. Not using backticks in query
17. Not proper usage of joins in query
18. Not doing most of the processing work in the SQL query itself
19. Not checking for a resource before using a result from query
20. Not using isset() and empty() at appropriate places
21. Using GLOBALS
22. Using addslashes instead of mysql_real_escape_string()
23. Functions having more than 25 lines
24. Non usage of foreign keys
25. Non usage of indexes
26. Non usage of views at appropriate places (this cannot be blamed a lot since it's introduced from mysql 5)
27. Inability to aggregate relevant functions into classes or putting them in the same file as groups
28. Passing db connectivity information at every page instead of using a DB class
29. Using root user for mysql queries
30. Inability to use grant and revokes for mysql users
and many more....


Last edited by raghavan20 on Thu Jan 26, 2006 7:32 am, edited 1 time in total.
User avatar
raghavan20
DevNet Resident
 
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK

Postby Gushy » Thu Jan 26, 2006 7:25 am

yeah there are a lot of style type things that I will be looking for, these are kind of instinct things when I'll be reading through the code rather than specific check items I'll be looking for. Except for any test questions where specifically I've done those things wrong in code for the candidate to fix.
Gushy
Forum Newbie
 
Posts: 7
Joined: Tue Jan 24, 2006 5:32 am

Postby onion2k » Thu Jan 26, 2006 10:17 am

3. No proper spacing between expressions
[this is bad: for($i=0;$i<mysql_num_rows($result);$i++);
this is good: for ($i = 0; $i < mysql_num_rows($result); $i++)]

Even ignoring the fact you've called a variable $i which is completely meaningless, they're both very bad. mysql_num_rows() will be called on each iteration of the loop .. if there's 1000 records in $result then mysql_num_rows will be called 1000 times.
$intTotalRows = mysql_num_rows($result);
for ($i = 0; $i < $intTotalRows; $i++) {

That will be MUCH faster.

If you don't believe me, try this:
Syntax: [ Download ] [ Hide ]
<?php



        echo "Starting ".date("H:i:s")."<br>";



        for ($i=0; $i < numberofloops(); $i++) {

                echo $i."<br>";

        }

       

        echo "Done ".date("H:i:s");

       

        function numberofloops() {

                sleep(5);

                return 5;

        }



?>


<pedant mode: off>
User avatar
onion2k
Jedi Mod
 
Posts: 5263
Joined: Tue Dec 21, 2004 6:03 pm
Location: usrlab.com

Postby John Cartwright » Thu Jan 26, 2006 10:34 am

How ironic..

3. No proper spacing between expressions
[this is bad: for($i=0;$i<mysql_num_rows($result);$i++);
this is good: for ($i = 0; $i < mysql_num_rows($result); $++)]


first of all the use of mysql_num_rows should not be within the loop, so it is not called every time.. instead

$numRows = mysql_num_rows($result);

Syntax: [ Download ] [ Hide ]
for ($x = 0; $x < $numRows ....


You also have a parse error in your 'good' version :wink:


Edit | Where did those 17 minutes go... damn.
Code: Select all
if ($toBe || $notToBe) echo 'That is the question'; 

NEW HERE?: Please read the Forum Rules, and take the Forum Tour before posting!
User avatar
John Cartwright
Site Admin
 
Posts: 11470
Joined: Tue Dec 23, 2003 3:10 am
Location: Toronto

Postby m3mn0n » Thu Jan 26, 2006 11:12 am

http://brainbench.com/xml/bb/business/h ... loyees.xml

Pre-Employment Assessment Test: Online Skill and Assessment Testing

Our assessment products give you the information you need to make more effective hires in an easy to administer, easy to interpret format, so you can focus on the decisions, not the paperwork.

Download our comprehensive Assessment Test Catalog that includes:

* More than 600 assessments
* Assessment types such as Skills, Knowledge, Personality, and more
* Job types such as Administration, Call Center, Finance, Health, IT, and more

Hire Successful Employees

Experts estimate the cost of a bad hiring decision at 20% to 200% of a year's salary. With stakes this high, it's no wonder more and more companies are integrating Brainbench assessments (for example, skill tests) into their hiring processes.

For example, our assessment products help you:

* Raise sales performance 10% or more
* Reduce turnover by 20% or more
* Cut your time to hire 50% or more and with less cost
* Improve the quality of your hiring interviews



That might be of assistance.
User avatar
m3mn0n
PHP Evangelist
 
Posts: 3546
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Postby Gushy » Thu Jan 26, 2006 11:20 am

nice thanks
Gushy
Forum Newbie
 
Posts: 7
Joined: Tue Jan 24, 2006 5:32 am

Postby m3mn0n » Thu Jan 26, 2006 11:22 am

No problemo. :)

I've not had any experience with that particular service, but I've seen demos of their tests for programmers, and I can assure you that it's a quality solution for your need.
User avatar
m3mn0n
PHP Evangelist
 
Posts: 3546
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Postby raghavan20 » Thu Jan 26, 2006 12:15 pm

onion2k wrote:
3. No proper spacing between expressions
[this is bad: for($i=0;$i<mysql_num_rows($result);$i++);
this is good: for ($i = 0; $i < mysql_num_rows($result); $i++)]

Even ignoring the fact you've called a variable $i which is completely meaningless, they're both very bad. mysql_num_rows() will be called on each iteration of the loop .. if there's 1000 records in $result then mysql_num_rows will be called 1000 times.
$intTotalRows = mysql_num_rows($result);
for ($i = 0; $i < $intTotalRows; $i++) {


I understand what you are saying but I was not really talking about speed issue, I just want to emphasize the importance of spacing between tokens. I just thought of giving some function inside a for loop to make it a little complex and thereby highlighting the importance of white spaces.
User avatar
raghavan20
DevNet Resident
 
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK

Postby timvw » Thu Jan 26, 2006 2:09 pm

- I'd ask them about general concepts: semaphore, mutex, recursion, ...
- Give them a couple of problems ask them which language/environment they'd choose. Pay attention to the motivation of their choices...

To test their deep knowlegde of php let them solve this brainteaser.
timvw
DevNet Master
 
Posts: 4897
Joined: Tue Jan 20, 2004 12:11 am
Location: Leuven, Belgium

Postby raghavan20 » Thu Jan 26, 2006 2:35 pm

timvw wrote:- I'd ask them about general concepts: semaphore, mutex, recursion, ...
- Give them a couple of problems ask them which language/environment they'd choose. Pay attention to the motivation of their choices...

To test their deep knowlegde of php let them solve this brainteaser.

Analytical questions are the best bet. But when you ask these kind of OS concepts with technical specialists, most of them would not be happy, they would rather expect to be asked questions relevant to their technical domain. These kind of questions are mostly targeted towards graduates and freshers where the company is willing to train any candidate who just has good analytical skills.
User avatar
raghavan20
DevNet Resident
 
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK

Postby Gushy » Thu Jan 26, 2006 3:14 pm

timvw wrote:- I'd ask them about general concepts: semaphore, mutex, recursion, ...
- Give them a couple of problems ask them which language/environment they'd choose. Pay attention to the motivation of their choices...
I certainly would agree with the concepts questions, I've found some of the good junior / mid-level coders I've worked with have a pretty good graps of syntax and baasic concepts but have a limited structured/literal thought process and don't think to use things like recursion. Or at least attempt to use it and can't get their head around it. A test that is purely code will not necessarily prove their grasp of concepts especially in the time that I'll have to adminster the test.

timvw wrote:To test their deep knowlegde of php let them solve this brainteaser.
Ooh that'd be a mean test in interview conditions.
Gushy
Forum Newbie
 
Posts: 7
Joined: Tue Jan 24, 2006 5:32 am

Re: PHP / MySQL Testing Job Applicants

Postby tests4geeks » Thu Feb 14, 2013 7:31 am

Hi, there is online service, that has PHP and MySQL questions together:
http://tests4geeks.com/test/php-mysql

It has 30 questions.
Also there are separate test for PHP and MySQL. Each test has 20 questions.

Service is very easy. You need just to send the link of the test to future empoyee. You will receive the report automatically on email.
tests4geeks
Forum Newbie
 
Posts: 1
Joined: Thu Feb 14, 2013 7:21 am


Return to The Enterprise

Who is online

Users browsing this forum: Google [Bot] and 0 guests