Closed Poll: Testing an intern's mettle part 3



  • Just when I thought the fun was over, boss sends me a new CV. Another kid from the old Alma mater looking for internship. Oooh, look at that, almost a straight A student too!

    Of course, we all know that means very little. That's why our advert specifically asked for something extra. A github account. Stack Overflow account. A blog or other programming-related writings. Forum posts. Home-made project. At least a school project. Anything to demonstrate some kind of practical knowledge.

    And boy, did this kid deliver. Both github AND stack overflow link were pretty much the only info in his sparse email..

    Me: "Oh boy! I can't believe! Did I stumble upon some young maverick hacker? Is this the jackpot I was hoping for!?"

    <click>

    Err...

    So... the kid pretty much created these two accounts moments before he sent in his application. Either he's an idiot or he thinks we are idiots.

    Ok, I'm slightly offended, but also intrigued. That's a gutsy move, kid.
    And look, he attached some kind of a project. Maybe that's his saving grace?

    So it's some kind of procedural PHP app. I quickly drop it into my wamp folder and open it up.

    Could not connect.

    Missing MySQL database? A little installation instruction would have been appreciated. In fact, there's no documentation whatsoever attached to the project. But OK, I can see the connect_mysql.php file. It probably auto-generates tables or something once you give it a database.

    Content of the connect_mysql.php, however, is NOT encouraging:

    $connect_error = 'Could not connect.';
    
    $mysql_host = 'localhost';
    $mysql_user = 'root';
    $mysql_password = '';
    $mysql_db = 'junior_name';
    
    if(!@mysql_connect($mysql_host,$mysql_user,$mysql_password) || !@mysql_select_db($mysql_db)){
    	die($connect_error);
    }
    

    mysql_connect... Not even with an i. Very strange... and suspicious.

    I set up some kind of database and try again. I get a decent looking screen:

    Looking through php sources, I can tell there's image upload involved. So the project is some kind of an address book or forum or something. Whatever.

    We'll never find out because no tables were autogenerated. Trying to submit the form resulted in a crappy-looking error. And there's no way I'm wasting my time reverse-engineering database from SQL queries.

    In the end, I just browsed through the sources a bit and tried to gleam some kind of insight into the kid's skill level.

    Uses English, check.
    Misspelled words in variable and table column names, uncheck.

    Lots of code of decent complexity for an intern, check.
    Very OLD looking procedural code, using old deprecated libraries, uncheck
    (suspicion++)

    Escaped strings in the "login" query, check.
    But in the "create account" query...

    $username = $_POST['username_signup'];
    $password = $_POST['password_signup'];
    $firstname = $_POST['firstname'];
    $surname = $_POST['surname'];
    $user_gander = $_POST['gander'];
    $user_date_birth = $_POST['birth_date'];
    $password_hash = md5($password);
    if(!empty($username)&&!empty($password)&&!empty($firstname)&&!empty($surname)){
    	$query_create = "INSERT INTO `users`(`id`, `username`, `password`, `firstname`, `surname`, `gander`, `birth_date`) VALUES (NULL, '$username', '$password_hash', '$firstname', '$surname', '$user_gander', '$user_date_birth')";
    	#....
    }
    

    Un-fucking-check.

    I hinted at it a few times, but I'll just say it. I'm suspicious if the kid wrote this at all.

    First of all, there's no PHP in any of the subjects he took at school. Second, why do I get such a late 90-ies feel from this code? Go to the PHP site and look up mysql_query commands. There's a HUGE warning, steering you towards either mysqli or PDO stuff. If you were just learning to program, wouldn't you want to learn the latest recommended technology? How would you even get to the idea to use mysql_query in the first place? Just follow a random SO advice? Very strange.

    So what really happened? Did the kid had a programmer friend send over some old project, so he could have SOMETHING to show? Or is the "kid" actually an older programmer himself, who did some PHP back in the day and is now just trying to get some education? I've been calling him "kid", but I have no way of knowing his real age; it doesn't say in the email.

    I don't know. Everything is strange about this candidate.

    So, what now? Should I give him a chance or reject him out of hand?

    ##YOU DECIDE

    Yes, dear TDWTF-ers, this time around I'm making it more interesting and leaving the decision in YOUR capable hands.

    Before the poll, a quick summary.

    GOOD:
    -- Excellent grades
    -- Lots of code in the sent-in project, solid quality for a 2nd year student
    -- Used technology not on school curriculum

    AMBIGIOUS:
    -- Fake github and SO accounts

    BAD:
    -- Old procedural style PHP
    -- No attention to details exhibited in the email and project
    -- Potentially not his code

    What say you?

    • Reject and burn the CV
    • Don't know... let me just check this option until I decide
    • Call him in for a test and post the gory details
    • Don't care... these intern mettle threads suck. You suck. I hate fun.

    Poll closes this time Tomorrow.



  • Don't care... these intern mettle threads suck. You suck. I hate fun.
    You misspelled `FILE_NOT_FOUND`.
    Filed under: FILE_NOT_FOUND_NOT_FOUND


  • Why, I do hate fun. Thank you for including that option, it's so nice to not feel excluded for once.



  • His javascript is all pure, no libraries. AJAX handler code:

    function createXHR(){
    	if (typeof XMLHttpRequest != "undefined"){
    		return new XMLHttpRequest();
    	} else if (typeof ActiveXObject != "undefi ned"){
    		if (typeof arguments.callee.activeXString != "string"){
    			var versions = ["MSXML2.XMLHttp.6.0", "MSXML2.XMLHttp.3.0","MSXML2.XMLHttp"],i, len;
    			for (i=0,len=versions.length; i < len; i++){
    				try {
    					new ActiveXObject(versions[i]);
    					arguments.callee.activeXString = versions[i];
    					break;
    				} catch (ex){
    				//skip
    				}
    			}
    		}
    		return new ActiveXObject(arguments.callee.activeXString);
    	} else {
    	throw new Error("No XHR object available.");
    	}
    }
    

    Ignoring the undefi ned bug, looks like copy-pasta. But no jQuery? And special handling of the IE stuff I've never seen before, but presume is from like IE5 era or something?

    Yet, all files are last modified one month ago at the latest.



  • @cartman82 said:

    Err...

    http://what.thedailywtf.com/uploads/default/7522/75b0d714b62c4c6f.png

    For a second there, I thought you posted his TDWTF forum profile. Now that guy I'd take.

    @cartman82 said:

    Ignoring the undefi ned bug, looks like copy-pasta. But no jQuery?

    My bet is it's copypasta, but "no jQuery" is a point for him - at least he knows how XHR work.

    Anyway, if you can spare that hour or two, bring him on - for good laugh, if anything.

    @cartman82 said:

    Second, why do I get such a late 90-ies feel from this code?

    Shitty profesors at the uni?



  • I dug up a link from one of the files.

    http://www.[something].byethost6.com

    Paste the link in navbar, ENTER.

    .......ok?



  • @Maciejasjmj said:

    Shitty profesors at the uni?

    No PHP course on the uni. At least none that he took.



  • @Maciejasjmj said:

    My bet is it's copypasta, but "no jQuery" is a point for him - at least he knows how XHR work.

    That's what's strange. Where can you find copypasta these days that's not jQuery?

    The point is, looks like OLD copypasta, from before jQuery.


  • Winner of the 2016 Presidential Election

    What Do you want to intern him for? Is he supposed to be working on PHP-related stuff? If so.... I feel like I could do better and I never had any PHP-course either. So thats a pretty big No!

    I also used mysql_query - without the i - but that was back in the days when the i-stuff was something new and shiny.
    I then also refused to use JQuery at some point just so I could learn how the Javascript and the DOM behave.

    Would I attach something like that on an E-Mail like this? No way. For that alone, you might as well ignore him.

    But it really depends on what you need him to do. And how much time you have to show him the ropes and stuff like that.

    I kinda want to see how he handles the tests you prepare but that is mainly entertainment-value.

    Filed Under: Didn't click on the poll because that's how I roll

    Addendum: Sidenote: Do you still have a link to Taim-2? I don't want to use Disco-search but I wanna find out what horrible things he did ;P



  • @Kuro said:

    What Do you want to intern him for? Is he supposed to be working on PHP-related stuff?

    No, just to have a basic programming know-how. If they are worth the time, we'll teach them what we need.

    @Kuro said:

    Addendum: Sidenote: Do you still have a link to Taim-2? I don't want to use Disco-search but I wanna find out what horrible things he did

    Oh come on, it's not THAT difficult to find.

    Part 1
    Part 2

    I just noticed. Part 1 was in Coding Help. Part 2 in general. I was pretty confident to place Part 3 in the Sidebar. Things are not going well.



  • @Maciejasjmj said:

    My bet is it's copypasta, but "no jQuery" is a point for him - at least he knows how XHR work.

    I bet he doesn't. Anyone that does that copy/pasta almost certainly has no idea. That's pre IE6 support right there, and I'm surprised anyone would continue to keep that around unless they have legacy cruft in their codebase and just haven't trimmed the fat lately (like years)

    Sorry, no, this smells too icky, voted no - as fun as intern-torturing is, this is going to be shooting fish in a barrel.



  • So here's what I see:

    A pile of PHP with no discernible source, but:

    Presuming the github account is new he as proven that,

    • He can make an account on github
    • And he can figure out how to register on stack overflow
    • And he can figure out how to upload source files to github (a pretty good feat in itself)

    He's supposed to be an intern which means it's pretty unlikely to find any real code that he has to associate himself with, and he might be embarrassed of any real code he does have. It's pretty easy to determine if the code is his or not, namely ask him how long it took to make, some issues he encountered while making it, why he chose to MD5 the password instead of another type of encryption like SHA(xxx). If he can't speak to those, it's not his code.

    From the looks of the site, it looks like a prebuilt site template that they have on the big free template farms out there, google image search suggest chrome NYC desktop background image and templatemonster.com

    Your connection script (connect_mysql.php) looks like a dead ringer for this:

    I'd still bring him in and grill him, but I would spend the interview focused on his supposed work on the code unless he says he only modified it (then go through the other gauntlets) - but mostly because I want more material for the site.


  • FoxDev

    @Matches said:

    but mostly because I want more material for the site.

    QFT

    also +1

    :-D



  • @Matches said:

    And he can figure out how to upload source files to github (a pretty good feat in itself)

    When did that happen?



  • Did I misread the original post, and he was emailed the source, not attached to the github?

    Looks like I might have, he made the accounts and linked them, but I made the assumption the attached source was actually in the github.

    Well, even if it wasn't... I still don't fault him for that. In fact, maybe that's a good thing.



  • It says "he attached some kind of a project", I assumed that meant attached to the email, but now that you mentioned it, maybe I misread it.



  • I am saving this forever on a quadruple raid and with off site vault backup technology.



  • @Matches said:

    I am saving this forever on a quadruple raid and with off site vault backup technology.

    😆


  • :belt_onion:

    user_gander? lol

    @Arantor said:

    pre IE6 support

    = he got this from a classmate that inherited it from a classmate that....


  • :belt_onion:

    they've ( community.sitepoint.com ) gone dicsourse? 😦
    also: http://community.sitepoint.com/t/where-have-all-our-smilies-gone/97457 ha.



  • @Matches said:

    Your connection script (connect_mysql.php) looks like a dead ringer for this:

    He didn't use the .inc convention. Probably not that one exactly, but something similar.

    @blakeyrat said:

    It says "he attached some kind of a project", I assumed that meant attached to the email, but now that you mentioned it, maybe I misread it.

    No no, the github is 100% empty. This came as anonymous zip in the attachment.



  • At least the guy is motivated enough to work with you so he created the GitHub and SO account. And you don't mention if the advert mentions having anything useful in those accounts. So that's a plus for motivation and following strict rules.

    For everything else, I mean, you're looking for an intern who is mostly going to be doing grunt job. I guess that you're better looking for a person motivated with basic skills like being organized, listens to your commands and makes good coffee.



  • Poll closed.

    Interesting. That's a lot YES votes for a pretty iffy candidate. Hmm, I wonder... is it possible... that maybe, just maybe... some of the yay voters had allowed their base urges towards funny intern testing entertainment to override their better senses?

    Nah, I'm just being silly. Yays have it!

    Just sent this to my boss:

    I looked into the application.

    A few upsides and a few downsides with this guy. We can talk tomorrow in greater detail. Bottom line is: he's interesting enough to call him in for a test.

    Now we wait.


  • Garbage Person

    @cartman82 said:

    Bottom line is: he's interesting enough to call him in for a test.

    You misspelled entertaining.


  • I survived the hour long Uno hand

    @cartman82 said:

    some of the yay voters had allowed their base urges towards funny intern testing entertainment to override their better senses

    QFT



  • If you didn't make them so entertaining we wouldn't be having this conversation. Actually, we can all agree that this is front page material.



  • Test scheduled for tomorrow 12:00 GMT.



  • @cartman82 said:

    Test scheduled for tomorrow 12:00 GMT.

    Yay! Same thread or new one?



  • Same


  • Fake News

    @cartman82 said:

    Interesting. That's a lot YES votes for a pretty iffy candidate. Hmm, I wonder... is it possible... that maybe, just maybe... some of the yay voters had allowed their base urges towards funny intern testing entertainment to override their better senses?

    See, this is why we actually needed a fifth option. Something like "Hire intern immediately for the benefit of the glorious frontpage of thedailywtf".

    @darkmatter said:

    also: http://community.sitepoint.com/t/where-have-all-our-smilies-gone/97457 ha.

    That's what happens when you let rabid wild smileys breed, you get an infestation.

    Also +1 for the "Ctrl + C, Ctrl + V" smiley insertion technique described on that page.



  • It just occurred to me, it's gonna be interesting peeping on intern candidate #3 during his test while intern candidate #1 (who started working today) is sitting pretty much right next to me...



  • "Oh no, this is my first time doing this. I'd never do that you, AwesomeIntern!"



  • It should be edifying for him.



  • Today's tasks.

    Task1:

    Write a function that takes two integer arguments and writes out numbers from 1 to 100, except
    - if number is divisible by the first argument, write "FIRST"
    - if number is divisible by the second argument, write "SECOND"
    - if number is divisible by both arguments, write "BOTH"
    
    Example:
    
    > task1(2, 3)
    
     1
     FIRST
     SECOND
     FIRST
     5
     BOTH
     7
    ...
    

    Yes, it's a modified fizz-buzz. If they learned the solution by heart, hopefully this will be enough to confuse them.

    Second task is again mott's excellent csv problem.

    In a language/IDE of your choice, read in the text file.
    
    c:\Project\Testing\fruit.txt
    
    Print the contents of the file to the screen,
    sorted by the highest price first
    and ignoring items with a quantity of more than 150.
    
    ------
    
    PRODUCT            PRICE             QUANTITY
    Apple              1.75                125
    Watermelon         3.15                 20
    Orange            10.80                218
    Pear               0.99                116
    Pineapple          4.75                 45
    Banana             7.12                196
    Kiwi              13.06                 15
    

    A few modifications. I tweaked the prices so that string sorting will produce wrong results. They'll have to convert the second column to numbers.

    Also, I'm no longer calling the file "csv", because 1. it isn't 2. I don't want them to easily find a SO snippet like the last time. If they recognize that the format is kind of like CSV and google that, more power to them.

    The third task is my WTF table. No one has gotten that far yet. I doubt this guy will.



  • I have a good feeling that this candidate will wipe your OS and code the solution in PHP. Fingers crossed.



  • @Keith said:

    wipe your OS and code the solution in PHP

    In that order?



  • @VinDuv said:

    In that order?

    They would install some flavour of Linux in between the two:

    http://what.thedailywtf.com/t/testing-a-juniors-mettle-part-2/3663/30?u=keith



  • @cartman82 said:

    Yes, it's a modified fizz-buzz. If they learned the solution by heart, hopefully this will be enough to confuse them.

    Seems much too easy. If he knows FizzBuzz, he'll figure that out in no time, then he'll be up for not-CSV, where he'll crash and burn.

    I'd throw another task in if he handles FizzBuzz suspiciously easy. That string one from part 2 was nice, let's see if he can get any clever solution.



  • I was thinking of maybe adding "and sum all the remaining numbers" or something, if they find it too easy.

    But yeah, the second task is the real test. This one is not "whether they'll solve it", it's "how confident they'll be while solving it".



  • [s]Countdown here.[/s] Edit: See below for the correct countdown.

    Is anyone else quite excited? I'm getting a feeling similar to the murmuring you get in the cinema before the start of a much anticipated movie.

    This definitely needs to be a regular feature.



  • @Keith said:

    Countdown here.

    Is anyone else quite excited? I'm getting a feeling similar to the murmuring you get in the cinema before the start of a much anticipated movie.

    This definitely needs to be a regular feature.

    Except you're off by an hour. He should be here in 30 min.



  • Your fault for using GMT... so 90's



  • @cartman82 said:

    Except you're off by an hour. He should be here in 30 min.

    Erm...

    http://what.thedailywtf.com/t/closed-poll-testing-an-interns-mettle-part-3/3764/27?u=keith

    It's currently 10:39 GMT.



  • Fucking London time.

    From here: http://www.timeanddate.com/worldclock/



  • Ah, BST. ;)

    Fixed countdown.



  • Fuck me.

    How the fuck is London not GMT!?



  • We're on summer time right now.



  • Another great feature to add to Discourse: events sharing to Google Calendar.



  • I hate time zones.



  • On the plus side, next time you can just give your local time and time zone and let the countdown timer manage it.


Log in to reply