@JordanL said:
>In Objects, what is visibility and how does it change the output?
This question is confusing. For one thing "Objects" is a common noun that should not be capitalized. Maybe you should "object-oriented programming languages". Plus "visibility" isn't a term that everybody uses. Finally, "how does it change the output" depends on what program we're talking about, how it's already implemented, and how you would change it.
@JordanL said:
Simplify the following code:
$a = 15 / $num_pieces;
$a_piece = floor($a);
$rem = 15 – ($a_piece * $num_pieces);
I see what you're asking, but the truth is that it's already in a simplified form. Perhaps a better question would be, "how could you rewrite these 3 lines into 1 line, and which form is better? why?" The first form (if you use good variables names) has the advantage of giving meaning to the subexpressions that are being evaluated in the last line.
@JordanL said:
Name one built-in function in PHP 5 which you can use to implement regular expressions.
Again, the wording is very tricky here. Developers are very literal, and what you're asking them is to name a function which [i]implements[/i] regular expressions, when I think you mean a function which [i]uses[/i] regular expressions. If you want to implement an entire regex engine, it's going to take far more than a single library call.
@JordanL said:
What is a relational database?
That's a vague question for a written test, but possibly a good conversation starter for an oral interview.
@JordanL said:
Consider the following statement:
SELECT * FROM tbl_generic LIMIT 0,1
(a) Add a clause to this statement returning records with an “id” larger than 10.
(b) Add a clause to the statement from (a) sorting the records by “rating”, from highest to lowest.
(c) Change the LIMIT clause in the statement from (b) to select 50 records starting with record 15.
(d) Change the SELECT clause in the statement from (c) to only select the “name” and “price” from tbl_generic.
This question is actually what prompted me to reply. In A, if you add "where id > 10", you'll still only get one row, even though the question uses the plural form "rows", implying that you should get all of them. This would be confusing to a good developer filling out a written test -- like I said, developers are generally very literal when it comes to programming (and usually that's a good thing). If this was an oral test, then he could ask questions to clarify, and the questions themselves would reflect well on the candidate; but on a written test he has no recourse but to either be a smart ass or else dumb down his answers.
@JordanL said:
What statement deletes all data in a MySQL table without deleting the table or table structure?
This could be "TRUNCATE" or "DELETE". A better question would be, "Which two SQL statements delete data from a table, and what's the difference between the two?"
Also I fail to see the distinction between "table" and "table structure".
If I were you, I'd be looking for somebody who understands core concepts of software construction, like those discussed in Code Complete. Also if you want to test for core competency, test them on version control, collaboration, and debugging too.