PHP/MySQL interview questions?
I am going to an interview soon for a PHP and MySQL programming position. Does anyone know what kind of programming questions or puzzles I need to look out for? I am in desparate need for this job and appreciate any help you can offer. Thanks.
I don't have much to offer on the question itself. I must say that if you are qualified for the job, then you won't have any problems answering the questions. If you aren't qualified, then you probably don't want a job that you will fail at. And whether or not you get the puzzle/question completely right isn't what anyone is looking for, they're looking for how you approach the question and make an effort to arrive at a solution.
I interviewed someone for a similar position. Based on a couple of discussions here, I don't asked nit-picky PHP-specific questions. I do ask "How do you prevent a SQL injection?" I present some poorly designed database tables and ask what's wrong/right. I asked how they'd approach a new project (looking for requirements, user interviews, design methodlogy, etc). I usually quiz on what they put on their resume to make sure they aren't just making stuff up. Sometimes I'll give them some code and ask what they think. A lot will depend on the specifics of the position.
What's an SQL injection?
SQL Injection is when form data contains an SQL escape sequence and injects a new SQL query to be run.
If you know enough about PHP/MySQL to feel comfortable applying fo the job, I would guess you shouldn't worry too much about the technical side of the interview. My take on it is that as long as you have a good foundation of programming concepts and prinicpals (i.e. functions, variables, classes/objects etc.) then you could be trained to acclamate to twhatever coding style their team uses without too much trouble.
Umm that SQL injection almost sounds lke a question I was once asked: if you call a function and you set a variable in that function will the value for that variable be available in your main section. And I really didn't know. I wish you'd cut my hands off if I ever wrote something like that. I wonder if SQL injections can happen if you do what everyone should do with data you cannot trust: validate it. Perl has taint for this. You can't use tainted data to do certain things until you untaint it. From what I've seen of PHP, most such programmers just assume variables into existence and they don't use the PEAR DB.php but instead just sprinkle sql statements all over their code and I rarely see anyone validating their input.
must remain anonymous
As what they like or don't like about PHP/MySQL, and why so. And how they would fix their deficiences. Always a good way to see if one knows his platform well.
I wasn't looking for any single response w/ my SQL injection question. There's a couple of ways to solve it. I want to know that they've run up against it and found some way of dealing with it. I liked your answer BTW.
I was asked how to design a set of database tables that contained people, and musical genres, where each person could choose multiple genres. Just a simple many to many thing. Apparently I was the only candidate who could do that, so I got the job. Which probably says more about the quality of candidates in my city that anything.
Fog Creek Home