Code Portfolio

When evaluating a potential new hire or a new contractor, it helps to get a sense of what type of code is written. When I need to subcontract work or hire others, I like seeing a sample of their code. This is a great first level filter. If I see gross PEP 8 violations, unnecessarily clever (and harder to read) code, or just plain old naive programming, I know I can immediatley move to the next candidate.

In that vein, I wish to provide code samples that I have previously submitted to others. There are five main categories that these samples fall into:


  • Mentorship

    Shannon Behrens (we call him JJ) is the one person who codes like I wish to code. Although I'm not on JJ's level yet, it is my goal to get there some day. Not only is he knowledgeable, but he is also disciplined to write well-commented, PEP-8 compliant, and fully standard code.

    Don't let the adherence to standards make you think of rigid, slow, expensive or inflexible programming. For example, writting well-formed comments first in a function makes one organize one's thoughts first. And, my experience is that this process makes the entire process faster since, by the time we start writing actual code, we have a solid understanding of what this particular function should do exactly.

    I didn't know JJ before I tracked him down and asked him to be my mentor. He kindly accepted mentoring me and assignments that he has given me have been included here. However, because he has been busy with Ruby on Rails this past year and I have been continuing to review the fundamentals, there's currently only one code assignment: JJ's Maze.


  • Previous Interview Questions

    As part of the interview process, I'm often asked to write small programs. These problems were designed to evaluate my code-writing ability and thus are great examples for first-pass evaluation. Some of these results will need to be password-protected since they may comprimise the test for the company that originally asked me to write the problem. I will happily provide access for a specific individual that wishes to evaluate my ability to write code. Bank Account is an example of code written for an interview question.


  • Algorithms - MIT Press

    The ability to write well formed programs from standard algorithms is important. Even the simplest choice in code design can make a very large difference when the input grows large. These examples are more academic in the classical Computer Science sense.

    My personal goal is to implement every algorithm in the MIT-press, Introduction to Algorithms text. This is the text that was required for my Algorithms course at University. However, in an academic setting, only a small sample of exercises are chosen for students. And, sadly, some algorithms - even the simple black-white tree - were skiped. This gives me an opportunity to implement these algorithms, front to back, at my own pace in C, C++ and with a Python/ctypes binding.


  • Facebook Puzzles

    Although I am not looking to get hired at Facebook, these are great little samples of code and problems to demonsrate my coding ability. At this stage, I've only done Hors d'oeuvre and Snack level programs as I have only recently learned of this resource. To protect the solutions, these are password protected. A password is available to those who wish to evaluate my solutions.


  • Python Challenge

    I first cut my teeth on the Python Challenge. I remember fondly asking for code review on these small python-specific nuggets. The python community, especially BayPIGgies, were incredibly helpful.

Bank Account
Keywords: Object orientation, Python

When interviewing for the job at Egnyte, I was given a technical problem to solve:

Write a class to handle a bank account; feel free to make whatever assumptions you like. Bonus for documenting your assumptions.

I like trying to make general re-usable solutions when I can. This simple toy-example 'account' code can be configured for American Dollars, British sterling, and other general uses of a banking account.
http://svn.glenjarvis.com/code_portfolio/interview/bank_account

JJ Maze
Keywords: Python, Algorithm, Mentorship
http://svn.glenjarvis.com/code_portfolio/mentorship/maze

Facebook Puzzle: Hoppity Hop!
Keywords: Python, Facebook Puzzles, Hors d'oeurve, hoppity
http://svn.glenjarvis.com/code_portfolio/facebook_puzzles/hoppity

Facebook Puzzle: Meep meep!
Keywords: Python, Facebook Puzzles, Hors d'oeurve
http://svn.glenjarvis.com/code_portfolio/facebook_puzzles/meepmeep

Facebook Puzzle: Liar, Liar
Keywords: Python, Facebook Puzzles, Hors d'oeurve
http://svn.glenjarvis.com/code_portfolio/facebook_puzzles/liarliar

Facebook Puzzle: Breathalyzer
Keywords: Python, Facebook Puzzles, Hors d'oeurve
http://svn.glenjarvis.com/code_portfolio/facebook_puzzles/breathalyzer

Python Challenge: Challenge 0
Keywords: Python

http://svn.glenjarvis.com/code_portfolio/python_challenge/level_00