Last minute geek

last minute tech news from around the net

Friday, Aug 17th

Last update01:00:00 AM

You are here: English WTF CodeSOD: This Interview Doesn't Count

CodeSOD: This Interview Doesn't Count

User Rating: / 0
PoorBest 

There are merits and disadvantages to including any sort of programming challenge in your interview process. The argument for something like a FizzBuzz challenge is that a surprising number of programmers can’t actually do that, and it weeds out the worst candidates and the liars.

Gareth was interviewing someone who purported to be a senior developer with loads of Java experience. As a standard part of their interview process, they do a little TDD based exercise: “here’s a test, here’s how to run it, now write some code which passes the test.”

The candidate had no idea what to make of this exercise. After about 45 minutes which resulted in three lines of code (one of which was just a closing curly bracket) Gareth gave the candidate some mercy. Interviews are stressful, the candidate might not be comfortable with the tools, everybody has a bad brainfart from time to time. He offered a different, simpler task.

“Heres’s some code which generates a list of numbers. I’d like you to write a method which finds the number which appears in the list most frequently.”

import java.io.*;
import java.util.*;
class Solution {
  public static void main(String[] args) {
    List<Integer> numbers = new Vector<Integer>();
    numbers.add(5);
    numbers.add(14);
    numbers.add(6);
    numbers.add(7);
    numbers.add(7);
    numbers.add(7);
    numbers.add(20);
    numbers.add(10);
    numbers.add(10);

    // find most common item
    for(Integer num : numbers){
      if(num == 5 ){
        int five += 1;
      }
      else if(num == 14 ) [
        int foue=rteen += !:
        }
   }
}

Gareth brought the interview to a close. After this, he didn’t want to spend another foue=rteen minutes trying to find a test the candidate could pass.

[Advertisement] ProGet supports your applications, Docker containers, and third-party packages, allowing you to enforce quality standards across all components. Download and see how!

Read all
Comment Policy:
We pre-moderate any comments and welcome all kinds of thoughts, supportive, dissenting, critical or otherwise. We delete or censor comments that are:

* abusive
* off-topic
* contain personal attacks, or against any company or organization
* promote hate of any kind
* use excessively foul language
* is blatantly spam or advertising

We do not discriminate based on the person who is posting, and we never censor comments for political or ideological reasons. We never delete an appropriate comment because we disagree with its viewpoint or ideology, and we never publish an inappropriate comment because we agree with or support its viewpoint or ideology.


Attention spammers: we manually approve all comments. Spamming and blatant advertising will NOT be published on this site and is deleted immediately, you've been warned, do not waste your time here.

Add comment

Security code
Refresh