Wednesday, April 30, 2008

A Test

A friend of mine recently applied for a job and received the little test included below that I'd like to share. As someone who has to interview quite a lot of people, I thought it was brilliant because I generally do not like programming problems for interviews as they tend to focus on Computer Science style knowledge that doesn't really apply in the real world.

For this very reason, I don't think I could get a job at google (if I actually wanted to), yet I know I am smart and have shipped quite a lot of wonderful useful code. As far as I can tell, they are looking for CS majors, not people who ship great code.

This particular test is more unique than others that I have seen. It isn't a hard problem, if you know what you are doing. Instead, it is a test of how well you can follow directions and think about basic OO code design. I also like the JUnit and ant requirements. There is also several different valid ways to go about solving the problem. Creativity is encouraged.

Another reason why this test is great is because we generally ask for code samples from people we decide to hire. There has been several times now where someone passes the interview with flying colors (ie: great personality), yet they can't code for shit. Really, I have seen stuff like this:

String foo = new String("my string");
if (foo != null) { doSomethingFun(); }

Sadly, showing a complete lack of fundamental knowledge of the Java language. We have also gotten people who send us source code that is copyrighted by their employer!?! Even after we specifically asked them not to send us copyrighted code. Um. Next.

If you are looking for a job, please please please have some quality work to show. The best candidate will have at least contributed to an existing open source project. Even better, create your own! Nothing is more appealing to a future employer than someone who is motivated enough about their profession to spend at least some after hours time working on their own ideas, building communities, sharing knowledge, etc.

Model a simple class library in Java for the representation of a bicycle.  Show basic OO principles in this class library. Keep the approach simple, and show good balance of class responsibilities. Implement the library for 3 bike types.

Question should be answered by each implemented bike type:

Determine the Max and Min speeds in MPH for the road bicycle, mountain bicycle, and kids tricycle.
  • For geared bicycles, Max and Min speeds should be calculated at a given front crank RPM. For Unit Tests, assume 90 RPM.
  • For non geared bicycles, Max and Min speeds should be calculated for reasonable human RPMs.
Solution should contain:

Turn in one simple console app that performs the Max and Min speed for each bike type. Use JUnit to do the testing and ant for the build. Use Java5 style generics and collections where necessary. Submit a .zip file with everything in it.

Some things to think about a bicycle for your model:

Road bike
  • Light, larger diameter Wheels, smaller width, higher pressure tire:
  • Tire size 700c
  • Gears, two sets:
  • Front: 50-39-30 teeth
  • Rear: 11-28 teeth , 10 speeds (11,12,13,14,15,17,19,21,24,28)
  • Two wheels
  • Rigid front fork
  • Generally lighter than a Mtn. Bike
Mtn. Bike
  • Heavy, smaller diameter Wheels, Large width, Lower pressure tire, more rolling resistance:
  • Tire size 26 Inches
  • Gears, two sets
  • Front: 48-36-26 teeth
  • Rear: 11-34 teeth, 9 speeds, (11,13,15,17,20,23,26,30,34)
  • Two wheels
  • Has a Front Fork – different travel 4-10 inches
  • Can have a rear suspension - different travel 4-6 inches, makes bike heavier
  • Generally heavier than a road bike
  • Small diameter wheels, multiple sizes
  • No gears
  • Three wheels


SteveL said...

Of course, modern mountain bikes run 42-32-22; 11-28 gear there is the option of '29' inch' wheel which is also 700c, but being that much wider a tyre has a bigger overall circumference.

Unknown said...

Your point is?