views:

146

answers:

2

I am hunting for a job and one of the companies that I interviewed with asked me to write a little test program so that they could test my programming abilities. I am a biologist by training, and most of my programming knowledge I gain by autodidactic means. I am also more comfortable writing Python then Java.

This is the brief I was given:

Write a java program, that uses and XML file with GO-terms (downloadable on archive.geneontology.org/latest-full/go_200911-termdb.obo-xml.gz), and presents the information in this file as a jtree, that consists of

  • level 1: all terms () in the file, to be visualized by their name ()

  • level 2: shows below each term the corresponding references as subnodes, to be visualized by their GO-identifiers On double-click on a reference the corresponding in the jtree has to be put in focus.

I have put the result I have coded up on github as a NetBeans project.

I welcome all constructive feedback. Also, upon seeing this code, what are some of the questions that I can expect?

+2  A: 

Just as a word of caution, remember that companies have been known to use complete "code samples" like this in their entirety. Such companies consider the interview to be an opportunity to get some free consulting and do not necessarily hire the "consultant".

spork
+1  A: 

Some comments:

  • you might return a List interface rather than the LinkedList implementation in GOTerm, so that the underlying implementation can be changed without you changing the calling code

  • you might use the enhanced for loop instead of the older for loop since you don't need access to the index positions when you are iterating in several places

  • you have a commented out line //private String is_a;

  • i don't know what isas stands for, so maybe it could be renamed, although maybe it's just me not knowing about the domain

  • myGOTerms is a non-parameterized Map, is that on purpose? Instead of Map<Something>

  • even in short methods, I'd avoid single letter variable names (GOTerm t)

JRL