Interviewing students (some findings)
(This is a ‘legacy’ blog post written in April 2010 – transferred over from our old website. Hopefully it will remain of use to others.)
In April 2010, I interviewed seven Computer Science students from Aberystwyth – with the intention of looking for a student to work for us on an Industrial Placement year from July 2010 to July/September 2011. For students the placement takes place between their second and third year of the degree – so they should have adequate programming capability already – in Java and other languages. I was happy for them to answer the question(s) in any language – or even some sort of pseudocode. I received a mixture of PHP and Java-like code
One student had a PHP 6 (haha) book with him which he used briefly for reference. Other’s didn’t seek assistance – although my laptop wasn’t on the University network.
- FizzBuzz – print out the numbers from 1 to 100, for multiples of 3 instead print out Fizz, for multiples of 5 instead print out Buzz, if both ‘FizzBuzz’.
- Recursion – firstly add up the numbers in a list; then try and modify your code so it works for a list of lists (i.e. 2d arrays).
- How do you read the last N lines of a really-large-file in an efficient manner
- Here’s some PHP code we discovered with a new customer, critique it.
Below is my take on how they performed
This shouldn’t take more than 5 minutes to write – a simple for loop with conditional statements using the % operator to detect if something is divisible by N with no remainder.
A couple of students seemed to think they needed an array to answer this; one didn’t seem to realise a loop was required and looked like he was about to write all possible numbers in an array and then iterate over it or something. Three students answered it pretty well – they knew they needed to use the ‘%’ operator, they had a loop in place and so on, and I suspect their code would have worked.
Writing a function which adds up numbers in an array passed in. As you iterate over the array, if an element is an array – call the function to calculate the total of what’s within it; otherwise it’s numeric so add it to the running total.
Four students couldn’t do this question. Two had some assistance from me; Three wrote code that was pretty much there – of these two effectively answered it correctly
From my point of view this question suitably separated the wheat from the chaff (so to speak)
This didn’t involve writing code; a number suggested reading it all into memory – but this isn’t efficient – and after discussion all but two thought of opening the file and reading backwards from the end
We [PalePurple] thought this was pretty horrible PHP (multiple security flaws, no (expected or unexpected) error checking, no logging, difficult to test, no reuse of code, automated submission of form possible (spam), no documentation/comments, lots of dreamweaver crap present and more). I’d identified 13 obvious issues with the code – and others were possible if they could justify them – as only one student did by picking up that a CSS style should not have been inline.
One student thought it was good code.
The others all picked up that it was vulnerable to SQL Injection.
Only one student was able to recognise two other issues.
This probably implies that the question was unfair – in that they may not have sufficient experience to recognise good (or bad) code when they see it. They should have all picked up on the SQL Injection issue, as I’d exposed this vulnerability in all of their ‘video games store’ projects they’d all used as examples of their work by email prior to the interview – but two didn’t until I effectively told them.
So, ding – ding – Round 2 approaches soon