![]() |
PHP / MySQL Programmer - What are good interview Questions?
So, I am hiring a PHP / MySQL Guru. Top notch. Good Pay. Free Red Bull.
Anyway, I have some decent interview questions.. but am looking for more. Post your PHP / MySQL Interview questions and answers here! |
What is localhost?
|
Are you or any of your family sick and/or dying, or will they be sick and/or dying when the deadline approaches?
|
Quote:
jDOG |
If they have any experience in optomization/streamlining both php code as well as mysql databases to run on higher traffic loads.
|
Quote:
jDoG |
Do you expect to get pregnant soon????
BTW, I know a good PHP/MySQL and ASP programmer. Experienced in high traffic sites and payment systems. ICQ me at 133480259 if interested.. |
I always make up shit in interviews and see if they act like they know it, LOL.
|
Quote:
I know... but you got to start somewhere |
php:
they should know how a class is written .. let them write a sample script. mysql: they should be able to define a left outer join .. |
".. how a class is written..."?? Real programmers don't need no stinkin' classes.. or is it don't have any class?? :Graucho
Ask him/her - how to surpress errors at runtime. - write code to randomize a list, eg: like shuffle deck of cards. - define tables for a "quick" bookstore database. |
Quote:
I've been coding php fulltime for 5 years now, and I only use classes when I want "pretty" code, I dont need them in php unless I wanna make something thats ultra easy to reuse, and I've only made 2 classes out of my last maybe 100 projects... Also, I've never required to use a left outer join EVER, so I dont know how that should be a req :-P (but I know how, just never use them myself) I would simply ask for examples of their work, and code snippets, I FUCKING HATE IDIOTS WHO MAKE UGLY CODE :D |
Quote:
|
Quote:
BTW - If you think you have the skills and want to apply, send me your resume. [email protected]. Position is in Santa Clara at our office. |
give them something like the following and see if they can get it to work:
$form = new Form("form1", hahahahahaha, "manage.php", "validateForm(this)"); $form->addElement(new formElementHiddenField("id", $id)); $form->addElement(new formElementHiddenField("mode", $mode)); $form->addElement(new formElementTextField("Title", "title", $title, 60, 255, "smallfield",true)); $form->addElement(new formElementTextField("Text Version", "textcontent", $textcontent, 60, 255, "smallfield",true)); $form->addElement(new formElementTextArea("HTML Version", "fullstory", $fullstory)); $form->addElement(new formElementSubmitButton()); $form->getForm(); I wouldnt expect them to be successfull but you will get an idea if the can figure stuff out and use classes etc.... thats what all my code looks like ;) |
ask them if you can do a goto in php like in perl and without making it a function
cos I wanna do that and I don't think you can icq me the answer 8775429! |
I'd say make em do something fun ... hell, there are tons of php contests out there, make em do one of them :D
|
classes are gay and people that only do stuff in php / mysql or think you need classes for shitty porn web stuff are super gay
mmap your graphics and install APC cache if your webserver is not using php unload the module stop being so gay and talking about classes |
At my last company we made up a little mini exam for all of the prospective developers...
5 separate mini programs printed out, 3 had a bug and 2 were written inefficiently... They had to correct the problem and explain why (writing with a pen). One guy ended up asking for extra paper, and by the time he was done had written what was basically an essay... We hired him :) |
Quote:
|
Quote:
|
How about.... 'do you have references'?
|
We have a small mysql/php test I made up here we use...15 question:
10 multiple choice 3 short answer 2 coding examples I can send you it by email if you like. No one ever got above 9/15 though but it's not that hard hehe. |
Just pulled out some of my old interview questions/tests. Too bad it's all C or assember. Here's a good "old" simple one.
$i=1; $i=$i++ + ++$i; echo $i; what gets displayed? Seriously, if he/she's going to be designing your databases, then having them do up a "simple" bookstore DB for you would be a very good idea. If they do it with 1 or 2 tables you've got a problem. |
Let me grab our programmer and get you a few
:thumbsup need something done contact me Thomas :thumbsup |
Quote:
|
Tests and essays are not a good pointer. The coder should be willing to do a small job before being hired, this should give you a good detail of how they code:
1. Take direction 2. Innovate 3. Perform 4. Deliver It is tuff to hire a coder, designers are easy because artistic ability is either bad, good, or excellent. Coders come in all shapes and sizes. V Hit me up on ICQ if you have any questions. |
using classes in php isn't necessary but a good programmer should know object oriented programming
|
Ask them how many pennies it would take to create a stack as tall as the Statue of Liberty.
You don't want the 100% correct answer, or anything near that for that matter, you should pay attention to how they think. If they're good problem solvers it'll be easy for them. That IMO is the biggest plus for a programmer. |
Quote:
i'd like to see what your test is, why don't you post it here for everyone to see? Maybe we could even improve it with everyone's feedback? There are some good suggestions in this thread, and some not worth even talking about:winkwink: But I think this test is pretty good for testing them out if you already have a programmer that can write it out for you and evaluate the results: Quote:
|
Quote:
|
bump:glugglug
|
Sorry everyone for the delay...
Soon as I can find it I will post it, if I still can't find where I kept my document I know at the office I have a hard-copy printed out I can type up. |
Here is the test we are using. It's something we came up with pretty quick, to weed out some candidates.
I'm sure it's not the greates and can be much improved, but it's working well for us. Mysql Questions 1 - You need a column type which will be able to store time and date in the range 1900-01-01 - 2199-12-31. Which column should you choose for this range? a. DATETIME b. TIMESTAMP c. Either DATETIME or TIMESTAMP d. Neither DATETIME nor TIMESTAMP will work for this range of dates. 2 ? You have the following table: mysql> DESCRIBE keywords; +------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+-------------+------+-----+---------+-------+ | article_id | int(11) | | PRI | 0 | | | keyword | varchar(20) | | PRI | | | +------------+-------------+------+-----+---------+-------+ 2 rows in set (0.00 sec) You want to find all articles that contain both the keywords 'MySQL' and '4.0'. How can you do this in one query? a. By using the BIT_COUNT() function in your SELECT b. By using the FIND_IN_SET() function in the WHERE part of the SELECT c. You cannot do this in MySQL d. You write a query where you join the table with itself 3 - What is MySQL AB? a. An upcoming version of MySQL that includes new table types b. The company that develops and promotes the MySQL suite of programs c. A MySQL client for use on UNIX platforms d. A form-based front-end for generating reports based on data in a MySQL server 4 - What is purpose of the mysqldump program ? a. it is used to resolve mysql core dumps and sending bug reports b. it is used for low-level interaction with MySQL table data c. it is used to dump table structure and content in text format d. it is used to flush all tables prior to shutting down the MySQL serve 5 - Suppose you have the following tables : mysql> DESCRIBE Country; +----------------+------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+------------+------+-----+---------+-------+ | Code | char(3) | | PRI | | | | Name | char(52) | | | | | | Capital | int(11) | YES | | NULL | | +----------------+------------+------+-----+---------+-------+ 3 rows in set (0.00 sec) mysql> DESCRIBE City; +------------+----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+----------+------+-----+---------+----------------+ | Id | int(11) | | PRI | NULL | auto_increment | | Name | char(35) | | | | | | Country | char(3) | | | | | | Population | int(11) | | | 0 | | +------------+----------+------+-----+---------+----------------+ 4 rows in set (0.00 sec) The tables are related through Capital in Country to Id in City and Code in Country to Country in City Which rows will the following query return? SELECT Country.Name, Capital FROM City, Country WHERE Capital = Id; a. It will return all rows from the Country table, with or without corresponding Capitals in City b. No rows, it will result in an error c. It will return all rows from the City table with or without corresponding Capital entries in the Country table d. It will return the number of rows in Country multiplied by the number of rows in City e. It will return all rows from the Country table that have corresponding Capitals in the City table 6 ? You encounter a corrupt table in MySQL. How do you resolve the issue? PHP Questions 7 ? What is the purpose of the PHP function print_r() ? a. used to automatically display text with line breaks b. displays information about a variable in a way that's readable by humans. c. is identical to ?echo? d. outputs a string of text in html format 8 ? Which of these is an invalid use of the PHP function substr() ? a. substr(?abcdef?,1); b. substr(?abcdef?,-1,3); c. substr(1,?abcdef?); d. substr(?abcdef?,0); 9 ? Using the PHP function date() , and assuming $time is the current time as a unix timestamp, how would you convert $time into the format ?25-11-2004 23:01? ? a. date(?D-M-Y h:a?,$time); b. date(?d-m-Y H:i?,$time); c. date($time,?D-M-Y h:a?); d. date($time,? d-m-Y H:i?); 10 ? You have just upgraded your version of PHP and you have noticed that a GET variable you were using in one of your pages is now coming up blank. What could be the cause, assuming your code has not been modified? a. the new version you are using doesn?t support GET variables b. the new version you are using will only allow GET variables when using the special variable $_GET[] c. the configuration option register_globals is now set to OFF d. all of the above 11 ? When using the PHP function header() to redirect a user to another location, what must you always remember? a. redirects of this type will not work in Netscape b. never use exit() after the header function or your redirect will not work properly c. always use exit() after the header function to prevent executing of code after the redirect d. you may not redirect to a SSL-enabled page (ie. https://) 12 ? What is the purpose of the php.ini file? a. contains list of global variables b. this file doesn?t exist c. is the default configuration file of PHP d. this file is no longer supported past PHP3 13 ? What is the value of $x, after the following PHP statement ? $a=1; $b=3; $c=5; if ($a = $b) { $x = 100; } elseif ($b > $c) { $x = 50; } elseif ($b < $a) { $x = 42; } elseif ($a > $c) { $x = 20; } a. $x = 100; b. $x = 50; c. $x = 42; d. $x = 20; 14 ? Your PHP script returns you the error ?Warning: mysql_connect(): Host not allowed?. How do you resolve the problem? 15 ? Write a block of PHP code to output every fifth (5th) line of a text file. To help you, here are some functions you might want to use: fopen -- Opens file or URL Description resource fopen ( string filename, string mode [, int use_include_path [, resource zcontext]]) fopen() binds a named resource, specified by filename, to a stream. If filename is of the form "scheme://...", it is assumed to be a URL and PHP will search for a protocol handler (also known as a wrapper) for that scheme. If no wrappers for that protocol are registered, PHP will emit a notice to help you track potential problems in your script and then continue as though filename specifies a regular file. fclose -- Closes an open file pointer Description bool fclose ( resource handle) The file pointed to by handle is closed. Returns TRUE on success or FALSE on failure. The file pointer must be valid, and must point to a file successfully opened by fopen() or fsockopen(). fgets -- Gets line from file pointer Description string fgets ( resource handle [, int length]) Returns a string of up to length - 1 bytes read from the file pointed to by handle. Reading ends when length - 1 bytes have been read, on a newline (which is included in the return value), or on EOF (whichever comes first). If no length is specified, the length defaults to 1k, or 1024 bytes. If an error occurs, returns FALSE. feof -- Tests for end-of-file on a file pointer Description bool feof ( resource handle) Returns TRUE if the file pointer is at EOF or an error occurs (including socket timeout); otherwise returns FALSE. |
Pro and Cons of Object Oriented Programming has been discussed plenty of times. OOP in a non-windows type environment is in my oppinion not at all needed though.
OOP in PHP is actually too slow in my oppinion, and I would NEVER use it. I usually look at old projects, if the script looks badly written or not well organized I would never higher them because it will be a pain to modify it later. ---- Tempest: $i=1; $i=$i++ + ++$i; echo $i; neat little trick question :) I must admit, I am not sure what the answer is of the top of my head in PHP, since I am not sure how it parses this stuff exactly. But $i should be 4. ($i = $i++ + ++$i evaluates to $i = 1 + 3 because $i++ will increase $i to 2, but evalutes to 1 and ++$i will increase it to 3 and evalute to 3, $i is then set to 1 + 3.) Correct me if I'm wrong Tempest. ---- KidCock.. lemme try your test.. maybe I can be the first getting above 9/15 <g> 1. a) 2. e) (lol) you write a query like this: select article_id, count(*) num from keywords where keyword='MySQL' or keyword='4.0' group by article_id having num=2; BTW, your table structure of keywords table sucks ;) 3. b) 4. c) 5. e) 6. I login to the db with the mysql client and run repair table <tablename>; (your table structure isn't the best again btw) 7. b) 8. c) 9. b) 10. c) 11. c) 12. c) 13. is not easy since I am not sure what was replaced by the damn forbidden words thing on GFY. but $x should be a), unless the $a = $b is not a hidden idea to confuse people and is just a bug in your script. 14. uhm, why is that a PHP question? Add the friggin connecting host to your grant tables in mysql. 15. writing php time, gimme a minute for that. next post. |
15.
you do give them damn weird functions to use, but you said I _MAY_ want to use them, I don't... so here goes: $file_to_open is the filename to print every 5th line from. Code:
Ok, what do I win? |
*bump* for kidcock
|
Ask him if he ever discovered a bug in php or mysql and be able to workaround till it get fixed.. :glugglug
|
Quote:
|
And goddamn, that's a tricky test!
|
Quote:
|
Quote:
|
Quote:
|
do you know, what is a PC ?
do you know, how does it look like ? do you know how to operate it ? tell me how, i dont know how does it works ? |
Quote:
You'd win a second interview if you were applying heh. I told you it wasn't so hard ;p but you'd be amazed the number of people who get around 5-6 / 15 only. We use it to decide who should come back for the 2nd interview (of 4 total interviews). You're only the second person to get the intended trick in the 13th question though. Out of something like 40 people we have interviewed. (the hahah was supposed to be a open bracket for the if/elseifs). |
YAY!
its a good test for average stuff, definately. A few nice trick questions. What was your expected answer for 2) though? |
| All times are GMT -7. The time now is 03:18 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123