Skip to content

Instantly share code, notes, and snippets.

@redspider
Created April 5, 2011 02:04
Show Gist options
  • Save redspider/902891 to your computer and use it in GitHub Desktop.
Save redspider/902891 to your computer and use it in GitHub Desktop.
This review set is targeted at small-team PHP developers, and is intended to act in concert with an SPOJ code review.
Databases
When should an index be used?
What is the difference between varchar and text (mysql, postgres)
Define ACID
Describe an SQL injection and how to defend against it
How would you store a password in a database?
The app has a need for a search page, how would you search for a keyword?
What is the difference between a character set and a collation?
Form handling
When should you use GET vs POST?
Describe XSS and how to defend against it
Sessions
When would storing sessions on the filesystem cause problems?
Apache
When would you reduce KeepAliveTimeout? what effect would it have?
When would you commonly use mod_expires? what effect would it have?
CSS
How would you write a CSS ruleset that placed a grey line in-between, but not above or below, a set of list items?
How would you write a CSS rule to place a blue musical note before every h3?
HTML5
How would you structure page markup and/or css so that you could have two columns, with different background colours, of equal height regardless of which had the longer content?
JQuery
How would you set a hover event on all a href's in a page, including any that might arrive later due to ajax loading?
PHP
What is the difference between a private and protected class method?
What data type would you use to store a money value?
When would the results of strlen() not equal the number of characters in a string?
Is the number 100 greater than the string "99.9"?
When would you use "include()" instead of "require()"?
Cryptography
What is the difference between SHA1 and CRC32?
When would you choose to use MD5 instead of SHA1?
Caching
Under what conditions would you cache a page?
Under what conditions would you cache the results of a database call?
Under what conditions would you cache the results of an image/chart render?
Subversion
What is the difference between a branch and a tag?
Debugging
Your PHP application is causing apache to crash, what steps would you take to figure out why?
Your PHP application slows down badly sometimes, what steps would you take to figure out why?
Clusters
If an application is heavily loading a single database server, how could you spread that load across multiple servers?
If an application is heavily loading a single application server, how could you spread that load across multiple servers?
General questions
Describe a time when things went very poorly on a project
What tools do you use by choice? (editor, language, desktop/server platforms, databases, nosqls, debug etc)
Justify your choice of editor?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment