Interview tests, call for help



  • Our company used to have a C++ test, of the "abcd" variety, not too representative. So when we recently decided we need someone with understanding of C++ and PHP, a colleague who does most of the PHP work now prepared a practical PHP exercise instead and we agreed to ditch the "abcd" test and use simple exercises for C++ as well. So here is the exercises we came up with:

    1. FizzBuz in C++. Small twist: Program should take three command line arguments, the upper limit, divisor for printing "Fizz" and divisor for printing "Buz".
    2. We give two tables and description what attributes should go in a third one. Task is to create the third table in MySQL, create PHP form for inserting to it and PHP form for showing result of some join (described in words)
    3. In C++ read all lines from file if given as argument, std::cin otherwise and print each unique string with number of occurrences, ordered starting with the most common.

    The candidates are sat at a (Win7) computer with Visual Studio (2008; we are unfortunately stuck with that as we also target WinCE) and cygwin with gcc and some decent editor (sublimetext). For PHP there is some server and MySQL with PHPMyAdmin.

    I was not personally at the interview (I am telecommuting), but the team lead told me and showed me the results. Problem is we had two guys so far, so we don't yet have much idea what counts as passable. So far both took over an hour to get anywhere with fizzbuz (both did get it done eventually though), then did not finish the PHP in over two hours and got the third as homework.

    So I'd like to ask you who have some experience with this kind of tasks (I know at least @cartman82; please? Others? Pretty please.), are we expecting too much? Should we give bigger choice of editors/IDEs or something? Also how harsh should we be with things like using mysqli instead of PDO and string interpolation in queries (I tend to consider the later a major offence even if mysqli_real_escape_string gets used)? We are looking for level that a decent college graduate or masters degree student can pass.


  • I survived the hour long Uno hand

    @Bulb said:

    a decent freshmen

    Freshman where? High school? You're expecting too much. Grad school? The tasks are trivial.

    If you're looking at interns, fizzbuzz unmodified is about right for them. If you're looking for a productive team member, your first task should not take over an hour.



  • @Yamikuronue said:

    Freshman where? High school? You're expecting too much. Grad school?

    Uh, wrong word (I am not native English speaker). I meant fresh graduates. At least bachelor degree. May be interns studying masters degree.


  • I survived the hour long Uno hand

    As I said, Masters' or PhD level students should have 0 trouble with your tests. Well. Unless they're in one of those crossover degrees and have never programmed before, in which case, treat them like undergrads.

    Undergrad freshmen may never have programmed anything before beginning the year. It's weird for those of us who have been programming as long as they've had access to computers, but it's very common to get to college, decide computers sound fun, and start a compsci degree with no prior experience.



  • This post is deleted!

  • I survived the hour long Uno hand

    oh, what level did you mean?



  • In my experience administering such tests, 85%+ of applicants will not be able to finish them or get meaningful code written. I don't know how many people went through your tests and interviews but it's possible you may not have reached the semi-competent 10% group yet, or the quite competent 5% group.



  • You know exactly what my experiences were. I have no further insight not shared here.

    The intern I took is working his balls off and improving at a nice pace, but I don't expect production level code from him anytime soon. The gap is just too large.

    The questions seem a bit harder then what I gave them, but I also gave less time (1 hr instead of 3). Whatever the case with the other two tasks, quality people should have handled that fizz-buzz stuff in 5 minutes top. I think my intern would have done it in 30 mins, and he has 2 years in a crappy school. So, I think you just got an unimpressive batch of candidates this time.

    @Bulb said:

    Should we give bigger choice of editors/IDEs or something?

    Yes. You're not testing their familiarity with a specific environment. You want to get as close to their core competency as you can, not shoot them down on unimportant stuff like the choice of library, platform or editor.

    Also, internet access. You didn't mention it, but it's very important.

    @Bulb said:

    Also how harsh should we be with things like using mysqli instead of PDO and string interpolation in queries (I tend to consider the later a major offence even if mysqli_real_escape_string gets used)?

    It doesn't sound like you came anywhere near the point where these considerations would come into play.


  • SockDev

    @Bulb said:

    1. FizzBuz in C++. Small twist: Program should take three command line arguments, the upper limit, divisor for printing "Fizz" and divisor for printing "Buz".

    If you can't do that in under an hour, then... get a job in marketing?
    @Bulb said:
    2. We give two tables and description what attributes should go in a third one. Task is to create the third table in MySQL, create PHP form for inserting to it and PHP form for showing result of some join (described in words)

    Creating the table: minutes. The rest: an hour, two at the most.
    @Bulb said:
    3. In C++ read all lines from file if given as argument, std::cin otherwise and print each unique string with number of occurrences, ordered starting with the most common.

    The requirements are a little vague, but assuming you mean count the unique lines, a naïve solution should take about ten minutes, an efficient one an hour or so.

    But then I'm a fast coder, so maybe I'm underestimating the time taken.

    @Bulb said:

    Should we give bigger choice of editors/IDEs or something?

    Yes and no. Yes, so they can use a familiar environment. No, to see how they adjust to something new and unexpected.
    @Bulb said:
    Also how harsh should we be with things like using mysqli instead of PDO and string interpolation in queries (I tend to consider the later a major offence even if mysqli_real_escape_string gets used)?

    If they don't know mysqli exists, let it slide; they can learn it later.


    As always, YMMV, no warranty implied, don't eat fatty or spicy foods, yadda yadda yadda.



  • @cartman82 said:

    The questions seem a bit harder then what I gave them, but I also gave less time (1 hr instead of 3).

    Well, we didn't set fixed deadline. They came around 2 pm, after some chat sat down to it around 2:30 and could go on until everybody was tired. The C++ is not a "whip-up" language, so I expect slower start, yet over hour does seem too much.

    @cartman82 said:

    Also, internet access. You didn't mention it, but it's very important.

    They had it, but we should probably stress the fact and encourage them to look up documentation as they need.



  • @cartman82 said:

    So, I think you just got an unimpressive batch of candidates this time.

    What surprised me is that a guy who claimed quite a few years of experience needed two hours just for the fizzbuz and apparently forgot about existence of the % operator, so he instead created a function like

    bool divisible(int n, int a)
    {
        int x,y;
        x=n/a;  // x is (int)
        y=x*a;
        return (y==n);
    }
    

    The team leader who was there with him confirms he told him he can use the internet.



  • @Bulb said:

    What surprised me is that a guy who claimed quite a few years of experience needed two hours just for the fizzbuz and apparently forgot about existence of the % operator

    Unfortunately experience is not necessarily an indicator of skill. I had one candidate come in who was nearly finished getting a master's degree in C.S. and had several years real-life experience at an overseas megacorp doing OCR/image parsing stuff that was way above my head, and 4.0 GPA all around. He also helped teach Java classes at the local University. When given his choice of IDE and environment, he picked Java and Eclipse and couldn't even get a working basic project structure put together.



  • @Bulb said:

    Well, we didn't set fixed deadline. They came around 2 pm, after some chat sat down to it around 2:30 and could go on until everybody was tired. The C++ is not a "whip-up" language, so I expect slower start, yet over hour does seem too much.

    http://ideone.com/lLqhZC

    In 10 minutes. That's included finding an online fiddle for C. And I'm not even a C programmer.

    They should have done it in under 30 minutes. Don't hire them.

    @Bulb said:

    What surprised me is that a guy who claimed quite a few years of experience needed two hours just for the fizzbuz and apparently forgot about existence of the % operator, so he instead created a function like

    Wow. That's like some idiot savant level WTF-ery there.


  • I survived the hour long Uno hand

    @Bulb said:

    We are looking for level that a decent college graduate or masters degree student can pass.

    Agreed: don't hire the idiots who can't get through task 1 in half an hour.

    I have never heard of the language "move" before, but I noticed it on the list of languages under repl.it. I started a stopwatch. I came up with http://repl.it/2n9 in 2:59.83. It solves the problem, though not efficiently and it'd be a bitch to extend.

    Yes, that's just shy of THREE MINUTES. I have a Master's degree, however, so ten times as long for an undergrad feels sufficient. Add time for reading from the command line, subtract time for "I am proficient in this language", it evens out.

    (I wish I'd recorded a screencast... I couldn't figure out function syntax, and I kept typing "int" to declare my variables.)


  • kills Dumbledore

    You've got an off by one error. That prints 0 to 29

    @Yamikuronue said:

    (I wish I'd recorded a screencast... I couldn't figure out function syntax, and I kept typing "int" to declare my variables.)

    If you click run session , it seems to include all of the code you ran, including:

    ReferenceError: int is not defined



  • No, @Yamikuronue! Don't listen to the call of the FizzBuzz epeen contest... We... must... resist ... Aggh!



  • @cartman82 said:

    Yes. You're not testing their familiarity with a specific environment. You want to get as close to their core competency as you can, not shoot them down on unimportant stuff like the choice of library, platform or editor.

    Also, internet access. You didn't mention it, but it's very important.

    The computation stuff is easy. I could do that in C++ no problem. But I definitely would have to look up stuff about dealing with command line parameters, not to mention crap like converting them to numbers. I just don't do that sort of thing regularly.

    Unless you really need them to know that sort of thing (or reading from a file), give them something that already has the data in a variable. Also, a basic skeleton like a main() or whatever the language uses wouldn't be crazy to me. It helps get the person started and into the meat of stuff.

    Depends on what you're trying to find out, of course.


  • I survived the hour long Uno hand

    I'm actually talking to a friend about doing some kind of race... streaming our way through some kind of simple task in a new language to both of us.



  • @Yamikuronue said:

    I came up with http://repl.it/2n9 in 2:59.83. It solves the problem, though not efficiently and it'd be a bitch to extend.

    The nested ternary operator thread is :arrow_left: :arrow_double_down: :left_right_arrow: :leftwards_arrow_with_hook: this way...


  • I survived the hour long Uno hand

    @Jaloopa said:

    You've got an off by one error

    No, I clearly meant to do 1- 29 :)

    The parameters weren't specified, after all


  • kills Dumbledore

    I'm sure this qualifies for some sort of badge, but it's not quite pendantry, so I'm not sure.

    Maybe I'll flag it anyway and let @pjh decide



  • @boomzilla said:

    The computation stuff is easy. I could do that in C++ no problem. But I definitely would have to look up stuff about dealing with command line parameters, not to mention crap like converting them to numbers. I just don't do that sort of thing regularly.

    Well, Visual Studio certainly can create a project template (and we'll add more IDEs next time; the preparation for the first candidate was a little rushed) and we expect candidates to be able to look things up. They have internet and are told they can use it.


  • I survived the hour long Uno hand

    @Bulb said:

    Should we give bigger choice of editors/IDEs

    For an interview, allow your candidate the same level of choice you'd allow them if they were hired. If you mandate an IDE, make the candidate use it, so you can see if they'll adapt to it well. If you allow choice, allow them to install whatever they like.


  • Grade A Premium Asshole

    @Bulb said:

    They have internet and are told they can use it.

    Beyond that, I would tell them that they are expected to use it. I would rather a person realize that something is unfamiliar and go straight for documentation that to just fuck around with what they do know until it sort of works. It would also help eliminate those who would write copy-pasta from SO also. Keep an eye on them and see how much they copy and paste. A snippet here and there is generally OK as if it fits the bill there is no sense typing again. Constant copy and paste will be an issue though.



  • @Yamikuronue said:

    For an interview, allow your candidate the same level of choice you'd allow them if they were hired.

    We are somewhat limited in that anybody can edit in whatever they want, but Visual Studio (2008; we are stuck with that for WinCE) is usually the only practical debugger. Still, getting used to different environment isn't going to take long. So it's mainly we don't want to delay the interview by installing stuff.


  • Grade A Premium Asshole

    If you have one machine that you have set aside for interviewees to use, put the big ones on there: Notepad++, Sublime Text, Eclipse, VS, Netbeans, etc. Let them use what they are used to. Most people can adapt to the change of an IDE for a job, but to ask them to adapt quickly while under interview pressure might be asking a bit much?



  • I think expecting both C++ and PHP in a single warm body is expecting too much, frankly. You'll get someone who's good a PHP but shitty ad C++, or the opposite, because people who can do both are most certainly outside your pay range.


  • I survived the hour long Uno hand

    @blakeyrat said:

    both C++ and PHP in a single warm body

    Hi!

    @blakeyrat said:

    outside your pay range

    Nevermind, that's a good point :)



  • Clojure version using multimethods:

    (defmulti printfb (fn [x] [(zero? (mod x 3)) (zero? (mod x 5))]))
    (defmethod printfb [true true] [_] "FizzBuzz")
    (defmethod printfb [false true] [_] "Fizz")
    (defmethod printfb [true false] [_] "Buzz")
    (defmethod printfb [false false] [x] x)
    (doall (map (comp println printfb) (range 1 100)))
    

    Sorry! I'm Sooooorrrrry!



  • @Yamikuronue said:

    Hi!

    Well duh. I could do it, too. I wouldn't enjoy it. But I could do it.

    @Yamikuronue said:

    Nevermind, that's a good point

    Of course it is, I'm Blakeyrat.

    He's looking for someone to do it at "just-out-of-college" rates.

    There's a slim possibility you might find some kid who did C++ indie games (although it'll be crappy C++) and then did PHP in school, that'd be your best bet. But for the cost of finding that person, you're better-off just either hiring for one language and cross-training for the other (make sure you're 100% clear to the candidate that this will happen!) or raise the payscale.

    Unless you can afford to leave the position unfilled for 3 years until you find the right person.


  • I survived the hour long Uno hand

    I mean, I'm only a few years out of school myself, but I have a master's rather than a bachelor's. I did C++ in school and PhP for a side job doing websites for small businesses. And I get paid more than average.



  • @Yamikuronue said:

    For an interview, allow your candidate the same level of choice you'd allow them if they were hired. If you mandate an IDE, make the candidate use it, so you can see if they'll adapt to it well. If you allow choice, allow them to install whatever they like.

    I disagree.

    You need to determine primarily if the candidate can code. The IDE, environment, library choices... you can easily get them up to speed with all of those. If they can't code after 4 years of school, there's no helping them there.



  • Well, the guy who currently does the online services certainly does both and he accepted the job. He's not expert in either language, but it shouldn't take an expert to pass those tests.

    For what it's worth I used at least 6 languages throughout the university, from which 2 seriously (C and Perl back then; C++ and Java were already things, but the major project we had was C for various reasons).


  • I survived the hour long Uno hand

    Likely that means you're underpaid :)



  • @Bulb said:

    Well, the guy who currently does the online services certainly does both and he accepted the job.

    Company I worked for once hired an entry-level JavaScript/web design guy who turned out to be fucking savant, he was the best.

    That's called "luck".

    Like I said before, if your company can afford to wait 3 years hoping to luck out and find someone, then there you go. Problem solved. Most companies can't.



  • If I were you, I would ditch the PHP part and focus on C++ candidates. If the candidate knows C++ he'll adapt to PHP easily, the other way around, not so much (in my experience).

    About the IDEs, I don't know, I can do much of the basic stuff in any IDE but certainly, if you're recruiting C++/Windows devs, they pretty much should know how that goes. A PHP guy probably won't know about VS because it's outside of scope.



  • I dunno, I've found that system level programmers tend to write a lot of WTF web code or they try to make JavaScript into something more like Java/C++/C#.



  • @blakeyrat said:

    Company I worked for once hired an entry-level JavaScript/web design guy who turned out to be fucking savant, he was the best.

    That's called "luck".

    "Turned out"?
    Sounds like you might have missed a couple other skilled entry-levelers due to an inadequate interview process, then?

    [size=9](I'm not necessarily saying your process's less adequate than other companies. Maybe it's the best in the business but is still inadequate for finding entry-level talent)[/size]



  • No, he was like the second guy we talked to. At the sum-up meeting after the interview, I said, "we gotta make this guy an offer post-haste, he's by far the best candidate we've talked to in 2 years."

    I don't know what you think "turned out" means, but I don't think it's what I think "turned out" means.

    The point I was making is, we lucked out. "Hoping to luck out" doesn't make a very good business plan.



  • @blakeyrat said:

    I don't know what you think "turned out" means, but I don't think it's what I think "turned out" means.

    Thought you meant this is something you discovered after the interview. I suppose that could also mean something you discovered at the interview, though that's a bit weird because you weren't referencing the interview in your post.
    But crisis averted.



  • @lucas said:

    I dunno, I've found that system level programmers tend to write a lot of WTF web code or they try to make JavaScript into something more like Java/C++/C#.

    I'd say it depends more on how comfortable they are with

    1. FP (as JS is a FP language at heart, or at least most of the good parts are)
    2. SQL and databases (as that's what makes the meat and potatoes of the backend) and
    3. HTTP itself (as you won't get very far on the web if you don't understand HTTP)


  • Even more fundamental than that.

    They seem to care very little about the semantics of their markup and their styling is a total WTF, even if they get the JS, SQL and HTTP thing right. Also how many C++/Java or C# programmers were comfortable with functional programming, fuck most of them don't know SQL or respect HTTP ... WebForms exists.

    Web developers get a lot of flack, but I am fed up of people that thinking that the basics like good markup and CSS are easy. They aren't, when google are making things like Polymer and their are preprocessors for CSS like SASS which is an whole art in themselves.



  • @lucas said:

    They seem to care very little about the semantics of their markup and their styling

    We don't. We are not doing any! In PHP we do web services that are used by C++ client. It follows that

    @lucas said:

    JavaScript

    is not a thing here. To be honest if we were to start with it now we'd do the web services in Python. But back when we started somebody picked the first thing they thought about, PHP, and cobbled together some (ugly) scripts and switching the language now sounds like more effort than it's worth.

    @tarunik said:

    JS is a FP language

    Well, personally I consider C++ to be half functional and I tend to do a lot of somewhat-functional programming in it, though since we are stuck with C++03 (damned Windows CE) it's a pain to write the functionals. But that's advanced level; not everybody in the team is proficient with that and it does not matter much.



  • I was talking more generally.



  • @lucas said:

    They seem to care very little about the semantics of their markup and their styling is a total WTF, even if they get the JS, SQL and HTTP thing right.

    I was speaking from a backend-centric perspective. Frontend purism is a totally different animal, of course; although I can write reasonably-sane markup, that's mostly drawing on my experiences with LaTeX, translated loosely into HTML/CSS. JS, on the other hand, is something I avoid for the most part: if you want it to work reliably, you make the server do it, full stop.

    Filed under: Lynx still exists



  • @tarunik said:

    HTTP itself (as you won't get very far on the web if you don't understand HTTP)

    How often do you find yourself writing raw HTTP commands, though? Usually a library takes care of that part for you.

    Knowing what the various error codes mean could be helpful, though.

    Last time I did raw HTTP was when I still did stuff in PHP back in the mid 2000s.



  • The part of HTTP that it does help to understand is the fact that either the request or the response may get lost and the client can't tell which of the two happened.

    It seems most programmers just remember that TCP is "reliable" and think it means the request and response will eventually make it and there is no reason to handle failures. No. The only thing TCP guarantees that if a packet arrives, all packets sent before it already arrived and did so in correct order (were presented to the application in correct order). Even some protocol designers do; the lack of protocol-level acknowledge in xmpp is inexcusable.



  • @powerlord said:

    How often do you find yourself writing raw HTTP commands, though? Usually a library takes care of that part for you.

    Knowing what the various error codes mean could be helpful, though.

    Last time I did raw HTTP was when I still did stuff in PHP back in the mid 2000s.

    Even when you have a library to take care of the gunk, you still need to know GET vs POST vs ..., and what your various response codes do.

    @Bulb said:

    The part of HTTP that it does help to understand is the fact that either the request or the response may get lost and the client can't tell which of the two happened.

    Agreed; a end-user at a browser is simply going to see their page not loading and whack Refresh to spit another request into the ether. Also, as @Bulb helpfully pointed out, an automated client can find itself in a stickier wicket when confronted with unreliable networks...

    Filed under: non-idempotent requests are a hazard to correct functionality



  • @tarunik said:

    end-user at a browser

    If it's just user doing reload, the result is rarely worse than occasional duplicate entry from some form which is usually easy to recover from. Where it starts to be problem is when ajax is involved where user can't hit reload easily and especially when it's a service used by application. In our case we do mobile application that is mostly offline, but needs to access server to get data, check licenses and such and there we of course have to do all the error handling.



  • @tarunik said:

    you still need to know GET vs POST vs

    PATCH, TRACE, PUT... :sigh:


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.