Testing candidate's mettle S02E03
-
Sigh.
Couldn't help it.
Candidate has 10 years of professional contractor experience. Decided to do it in PHP.
Task:
-
Let's analyze his dev environment apps.
Sublime. WAMP. Filezilla. Photoshop. uTorrent.
Old school windows hacker.
expectations--
.
-
NOT promising at all.
-
WTF? Copypasta.
-
I cant believe he's still sniffing around get_file_content, even though he got the text into PHP.
You're not gonna find the "solve my entire problem for me" switch, pal.
-
WTF dude? You're regressing.
-
*pulls up a chair* This should be good XD
-
@cartman82 said in Testing candidate's mettle S02E03:
Candidate has 10 years of professional contractor experience. Decided to do it in PHP.
huh.... well then.... who has the popcorn?
-
@cartman82 said in Testing candidate's mettle S02E03:
You're not gonna find the "solve my entire problem for me" switch, pal.
Well, he could almost get it with
fgetcsv
supported regex as the delimiter...
-
Almost half an hour in.
Amazing. Those kids from session 1 did better than this.
-
@cartman82 said in Testing candidate's mettle S02E03:
Amazing. Those kids from session 1 did better than this.
Oh god, I called it session 1 without even thinking...
*season 1
-
-
WHY ARE YOU STILL HERE?
-
@cartman82 said in Testing candidate's mettle S02E03:
WHY ARE YOU STILL HERE?
Had to do some work.
Came back. It's still the same screen.
Wow.
-
@cartman82 said in Testing candidate's mettle S02E03:
Had to do some work.
Came back. It's still the same screen.
Wow.I hear toilet flushing.
He literally shat his pants when he saw the test?
-
@cartman82 said in Testing candidate's mettle S02E03:
He literally shat his pants when he saw the test?
perhaps.....
i'm choosing to believe that this is the case.
-
Now I'm fucking tempted to do this for fun, but I have actual work to do.
-
@Onyx
PHP = fun ...E_DOES_NOT_COMPUTE
-
I've been waiting for 10 mins to see the state of his code.
But he just keeps switching between the task text, the data and PHP help pages.Aiming for one last screenshot before I end the suffering.
-
@izzion Beats fucking Asterisk and trying to get multiple PJSIP AORs cooperate well with native queues...
-
Are you fucking shitting me? He opened some PHP 101 course examples, and is going through them.
-
@cartman82 said in Testing candidate's mettle S02E03:
Candidate has 10 years of professional contractor experience. Decided to do it in PHP.
@cartman82 said in Testing candidate's mettle S02E03:
He opened some PHP 101 course examples
w.o.w
-
@cartman82 said in Testing candidate's mettle S02E03:
Are you fucking shitting me? He opened some PHP 101 course examples, and is going through them.
I guess I picked the appropriate category this time.
-
Finally.
One last look at a 10 year veteran's stab at solving this junior testing task.
-
@cartman82 Veteran? Maybe he has PHPTSD and every time he opens the documentation he gets some sort of panic attack. Would explain the long periods of inactivity and maybe the toilet as well ^^
-
Me: Soooo.... how's it going?
Candidate: I never worked with files earlier, so I got a little stuck
Me: Do you think you'll figure it out in the next 10-15 mins?
Candidate: No I don't think so.
Me: OK.... well... thank you for this interview, and.... ummm.....
Candidate: OK, bye. (click)He couldn't shut down teamviewer fast enough. Glad I got that screenshot, for posterity.
-
@cartman82 said in Testing candidate's mettle S02E03:
I never worked with
filescomputers earlier, so I got a little stuck
-
@cartman82 said in Testing candidate's mettle S02E03:
WHY ARE YOU STILL HERE?
I would have been staring at that screen for a long time. "readfile – reads a file and writes it to Teh Output Buffer™"
Holy mother of fuck. I thought I knew most of those warts that PHP consists of, yet it never ceases to amaze me.
-
@LaoC I also love it how they bothered to mention that
@readfile
will suppress errors, even though pretty much no other function states that in its own documentation.$5 this is because a bunch of people complained in the comments after copy-pasting shitty/tutorial code from somewhere and not getting an error.
-
@Onyx said in Testing candidate's mettle S02E03:
@LaoC I also love it how they bothered to mention that
@readfile
will suppress errors, even though pretty much no other function states that in its own documentation.See, I had mentally blanked that out and now you have to remind me. The PAAAIIIN!
How do people come up with shite like that? "What was good enough for my .BAT files in 1985 is good enough for teh Intertubes any day"?
-
@LaoC said in Testing candidate's mettle S02E03:
"readfile – reads a file and writes it to Teh Output Buffer™"
TBH, I can't come up with a better description myself. Is your complaint that the page doesn't link to a description of how output buffering works in PHP?
-
@asdf The bigger problem is that he should have immediately realized that this is not appropriate for the task at hand. He isn't trying to pipe the page to standard output; he's trying to read it into a variable within the script.
-
@masonwheeler I get that, but it sounded like @LaoC was making fun of PHP instead of the candidate in the post I replied to.
-
@asdf said in Testing candidate's mettle S02E03:
"readfile – reads a file and writes it to Teh Output Buffer™"
TBH, I can't come up with a better description myself. Is your complaint that the page doesn't link to a description of how output buffering works in PHP?
I'm sure you could come up with a better name though! Of course in PHP it fits right into the mess that is
str_replace
,fixupstring_new
,str2int
,parse_utf8_s_to_float_or_something
,spelchek_dis_workingversion
etc.
-
@cartman82 said in Testing candidate's mettle S02E03:
NOT promising at all.
My first thought was that he went straight to Stack Overflow and asked how to solve it. Then I realized he was just researching.
-
@LaoC said in Testing candidate's mettle S02E03:
I'm sure you could come up with a better name though!
Yeah, but after years of PHP, I learned to ignore shitty names for standard library functions. I almost don't notice it anymore. Of course this function should be named
output_file
orpass_trough_file
or something like that.
-
@Polygeekery said in Testing candidate's mettle S02E03:
Then I realized he was just researching.
You can see the question reads, "I have this code working", which is one step above his efforts ;)
-
@cartman82 said in Testing candidate's mettle S02E03:
uTorrent
@cartman82 said in Testing candidate's mettle S02E03:
Old school windows hacker
E_NOT_COMPUTE
. uTorrent is only used for downloading Linux ISOs.
-
@Onyx said in Testing candidate's mettle S02E03:
Now I'm fucking tempted to do this for fun, but I have actual work to do.
Yeah, Cartman, put that .txt file onto a public server somewhere!
-
@Yamikuronue said in Testing candidate's mettle S02E03:
@Polygeekery said in Testing candidate's mettle S02E03:
Then I realized he was just researching.
You can see the question reads, "I have this code working", which is one step above his efforts ;)
Touche.
-
@cartman82 said in Testing candidate's mettle S02E03:
AMOUNT of 750 g or more
...
7.5 kg
Too bad he exploded, I was going to delight in his absolute horror in trying to do that part.
I would have put money on:
WHERE AMOUNT not like '%kg' -- because anything in KG is at least 1000 grams OR AMOUNT > '750 g' -- WHY IS THIS NOT WORKING?!?!?
-
@Onyx said in Testing candidate's mettle S02E03:
Now I'm fucking tempted to do this for fun, but I have actual work to do.
Last time around, IIRC, I did it two different ways, including one being a bit golfish, in about twenty minutes while a bit drunk. Doing it once while sober should really be a ten minute job.
-
@Arantor said in Testing candidate's mettle S02E03:
Last time around, IIRC, I did it two different ways, including one being a bit golfish, in about twenty minutes while a bit drunk. Doing it once while sober should really be a ten minute job.
This version is actually a bit more complicated, if you're gonna do it right.
I added some multi-word names in the left column. So you need to cut the header row, determine column indexes, then use those to parse the rest of the table. But mind those spaces in the header row as well!
It took me like 30-40 min to code a reference solution. If I just hardcoded column indexes, it'd be 20 mins.
-
@cartman82 oh, I kinda assumed it was the same as last time at a glance.
Might give it a go myself in a bit.
-
@Arantor said in Testing candidate's mettle S02E03:
@cartman82 oh, I kinda assumed it was the same as last time at a glance.
Season 1 was interns, so it was a bit more like CSV
Since these are supposed seniors, I wanted to beef it up somewhat. I shouldn't have bothered, it seems.
-
@cartman82 said in Testing candidate's mettle S02E03:
It took me like 30-40 min to code a reference solution. If I just hardcoded column indexes, it'd be 20 mins.
10-20 min to write a regex? Sounds about right.
-
@cartman82 said in Testing candidate's mettle S02E03:
So you need to cut the header row, determine column indexes, then use those the parse the rest of the table.
That's how I already wanted to do it last time. Seems more sensible and performant than
invoking Chtulhuusing regular expressions.
-
@asdf this assumes that the format will be cromulent, and as any fule kno it might not remain that way.
Debating to split on either 2+ or 3+ spaces, though I get why you'd split on header, just gotta trust the index points after that.
Oh and trust ASCII, not UTF-8...
-
@Arantor said in Testing candidate's mettle S02E03:
this assumes that the format will be cromulent, and as any fule kno it might not remain that way.
If you really want to test someone's mettle, give them several data sources to integrate. Make one use fixed-width records, one busted CSV, and one XML (with plenty of namespaces of course; bonus points if you can configure the server delivering this one to use random prefixes to two fetches of the data give the “same” document with a different byte sequence). Have them produce the output in JSON.
If they can do that, they can probably handle most anything. Eventually…
-
@dkf said in Testing candidate's mettle S02E03:
@Arantor said in Testing candidate's mettle S02E03:
this assumes that the format will be cromulent, and as any fule kno it might not remain that way.
If you really want to test someone's mettle, give them several data sources to integrate. Make one use fixed-width records, one busted CSV, and one XML (with plenty of namespaces of course; bonus points if you can configure the server delivering this one to use random prefixes to two fetches of the data give the “same” document with a different byte sequence). Have them produce the output in JSON.
If they can do that, they can probably handle most anything. Eventually…
Sounds like the task we gave my new padawan today. To which he seemed to handle it ok...