Solved

How to come up with 3 advanced PHP questions

Posted on 2012-03-28
15
368 Views
Last Modified: 2012-06-27
We're hiring senior PHP developer and at least 2 years experience. Can someone give me 3 advanced PHP questions that I can test the candidates?

I also need 1 question on using MySQL stored procedure
0
Comment
Question by:melwong
  • 6
  • 3
  • 2
  • +3
15 Comments
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37779727
1.How do you parse a huge (1Gig, e.g.) xml file in PHP?
2.How do you load any class on-the-fly without 'include' or 'require'?
3.How do you develop a real-time chat server with no page refresh?
0
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37779729
--- Which API do you use to execute a triple MySQL query which includes a stored procedure definition and execution?
0
 

Author Comment

by:melwong
ID: 37779735
Oh, and I do need the answers please
0
 
LVL 20

Expert Comment

by:Mark Brady
ID: 37780291
I'd like to know the answers to that myself! In fact, I have just relocated from New Zealand to Florida and in doing so have been faced with finding employment as a PHP developer. Every company (and Agent) I have been to see for an interview has put me through tests. Here is what I have seen in these tests so far.

One test was made up of questions almost entirely about classes (OOP) programming and had a few questions relating to the results of a certain function they stipulated. Some of the tests were multiple choice and some not. I was a bit peeved at one test which had a good portion of their questions relating to old php version prior to 5xx.

I my opinion, you should test their knowledge on classes if that is what you use (Object Orientated Programming), and some basic PHP stuff like Arrays (single and multi-level, loading data from a file, writing functions to manipulate the date and time.

Let me interrupt and say I had typed a whole bunch of stuff in here and accidently deleted it by mistake (Shows my computers skills hey!)

In any case the most important thing to really test them on is their logic. Logic skills is more valuable to a company than pure code writing skills. Have them write a basic login system with security and a remember me function so they will need to be able to create a basic database and a table and write a cookie in php and be able to check for that cookie to see if it is valid etc...

Do the basic PHP questions then make them work for it by displaying their logic. You can tell a whole lot about a coder by the way they think and it will also show experience or their indepth knowledge.

Anyway I hpe this has been of help to you and good luck finding the right person!
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 37781088
Ask them to explain how they learned PHP and what continuous education resources they would recommend to the team.

Ask them what version control software they like best and why.

Sidebar note regarding elvin66 comment on the basic login system.  You can find one here:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_2391.html

Best regards, ~Ray
0
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37781116
Whatever questions who present them with, ask them to explain their answers.
If you can't explain what you do, you don't now how you do it.
0
 
LVL 9

Expert Comment

by:rinfo
ID: 37781224
What are the predefined class in PHP
Ans:      Directory
       stdClass
       __PHP_Incomplete_Class
      exception
      php_user_filter

What precaution would you take processing a very big data file
Ans: Must put line like this at the start
        ini_set(‘memory_limit’,’50M’); replace 50M to the values that is appropriate .

What is the difference between temporary cookies and persistent cookies
Ans: When cookie is stored in browser memory and lives till browser is alive its a
     temporary cookie where as if cookies values are in a file in the user system and
     lives till it is deleted is a persistent cookie.

What is type juggling
ANs:Type Juggling in php  means automatically type conversion.

That is to say, if a string value is assigned to variable $var,  $var becomes a string. If an integer  value is assigned to $var, it becomes an integer.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 14

Expert Comment

by:Scott Madeira
ID: 37781536
I tend to agree with elvin66...  What you are really looking for is the ability to think and solve problems.  Especially true if you are hiring a junior to mid-level person (you specified 2+ years experience, I believe.)

If you are doing OOP then they should understand how to think in that paradigm.  If you are implementing as MVC then they should know something about that.  Because it is PHP they should understand the implications of loosely-typed languages (.NET developers struggle with that one.)

With Google, EE, etc. it is very easy to become a great PHP programmer if you understand "how" to program.  It then becomes a syntax exercise that most IDEs will help with.

When I interview developers for projects I give them a sample application to design and implement that involves front-end, middle-tier and database requirements.  They are given 20 minutes or so to develop their solution on paper and put it on the white board.  We then discuss what they put on the board in detail and we offer alternatives (some good and some bad) and see how the candidate responds.

The other thing you want to evaluate is their "fit" for your group.  Every team has a culture and you need to make sure there is compatibility.  We've gotten rid of great programmers in the past because they didn't fit into the group for one reason or another.
0
 
LVL 20

Expert Comment

by:Mark Brady
ID: 37781750
Thanks Ray for posting a link to a good sample login system, I didn't think to do that. I was assuming the asker would be able to read the written login scripts and follow the logic and security and be able to grade it. For the asker, on the other hand you could reverse the logical test and give them a script for perhaps again a login system and ask them to give you in writing what the script is doing with reasonable detail.

Of course you will already have other pre-employment criteria and the usual security checks etc... but keep in mind that most of us don't like being asked to do to much for an interview so if you make it to tricky or long they may loose interest and you may loose an otherwise good developer. Go for a team player every time!
0
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37781942
When I interview developers for projects I give them a sample application to design and implement that involves front-end, middle-tier and database requirements.  They are given 20 minutes or so to develop their solution on paper and put it on the white board.  We then discuss what they put on the board in detail and we offer alternatives (some good and some bad) and see how the candidate responds.

This is the best advice I've seen here.
If you demand answers to very specific questions you are likely to lose site of the fact that very experienced and well-rounded programmers don't necessary know every detail in a specific language. Not even PHP developers do!

But you do need someone who can program OOP, manage sessions, secure user input, query datastores, parse structured text and interface with other languages and server technologies.
0
 
LVL 9

Expert Comment

by:rinfo
ID: 37782704
I think the question specifically asked for some question that would be asked in a test.
It even asked for answer when someone provided questions only.
If intention was to test a prospective employee question should have been framed accordingly.
0
 
LVL 7

Accepted Solution

by:
designatedinitializer earned 150 total points
ID: 37782816
@rinfo: it was I who provided the questions, as requested.

Like I already stated above, I think questions should be broad enough that don't focus too much on syntax. I myself work day to day with half a dozen programming languages. I solve many problems on a daily basis, yet I don't know by heart if it's <needle>, <haystack>... or the other way around.

Here are your questions and hints of possible answers:

1.How do you parse a huge (1Gig, e.g.) xml file in PHP?
---- With a stream-type parser, because you can't hold the entire XML file on memory...
2.How do you load any class on-the-fly without 'include' or 'require'?
---- By defining an autoloader handler with spl_autoload_register('handler')
3.How do you develop a real-time chat server with no page refresh?
---- With sockets...

But questions only serve to weed out the absolutely terrible programmers.
A conversation with the prospect is the only way to reveal if he/she is a pro or a novice.
0
 
LVL 9

Expert Comment

by:rinfo
ID: 37782887
@ designatedinitializer
I entirely agree with you . I am a programmer . I have seen people who have passed
collage certificates in computer programming with very good scores but when it comes
to practical programming they come out a cropper.
And yes i entirely agree no written test will ever gauze capability of a programmer - a good one at that.
But my contention is user who initiated this question specifically asked to provide 3 question
for use in testing prospective candidates and not a way to test a prospective candidates thats all.
0
 

Author Closing Comment

by:melwong
ID: 37854057
good
0
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37854814
@rinfo
If you'd read this thread carefully, you'd notice that the very first answer was mine, and was a direct answer to the author's question...
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Creating and Managing Databases with phpMyAdmin in cPanel.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now