[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

How to come up with 3 advanced PHP questions

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
melwong
Asked:
melwong
  • 6
  • 3
  • 2
  • +3
1 Solution
 
designatedinitializerCommented:
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
 
designatedinitializerCommented:
--- Which API do you use to execute a triple MySQL query which includes a stored procedure definition and execution?
0
 
melwongAuthor Commented:
Oh, and I do need the answers please
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Mark BradyCommented:
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
 
Ray PaseurCommented:
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
 
designatedinitializerCommented:
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
 
rinfoCommented:
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
 
Scott MadeiraCommented:
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
 
Mark BradyCommented:
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
 
designatedinitializerCommented:
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
 
rinfoCommented:
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
 
designatedinitializerCommented:
@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
 
rinfoCommented:
@ 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
 
melwongAuthor Commented:
good
0
 
designatedinitializerCommented:
@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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now