News for hackers. Stuff that matters.
Re:Programmers At Work: Bill Gates (1986) by anthuswilliams on Thursday February 06, 2014 @11:38AM (#7191214)
In 2013 I briefly contracted for a PHP shop. The hiring manager would invite people in for an interview and present them with the following code:

  mysql_query('
    INSERT INTO `products` (`name`, `descriptions`, `price`)
    VALUES ( '.$_GET["name"].', '.$_GET["description"].', '.$_GET["price"].');
  ');
Then he would ask, "how do you feel about that?" He claimed this question weeded out a lot of potential candidates.
Re:Programmers At Work: Bill Gates (1986) by tanzam75 on Thursday February 06, 2014 @12:52PM (#7191731)
I like it.

I don't know if you can use this kind of test on fresh-out-of-college hires, because a lot of professors don't teach security, and there may be plenty of other bad habits to break anyway.

But on any experienced hire -- even someone one year out of school -- it's perfect for screening out the codemonkeys.