Experimenting with Python for fun

Background

Basically, between one of my co-workers raving about Python, and seeing numerous job postings mentioning Python as a "plus", I figured I should check it out. One of the first things that I've always written in a language is a a series of fibonacci functions. A simple exercise to learn the syntax.

Check it out!


More fun!

After that, I decided to take on one of the programming questions I have beend asked in an interview, as it's something meant to easily be done in less than an hour, once you figure out how to do it.

The question is:

Given a file containing pairs of a unique customer identifier and a URL, ordered chronologically, develop an algoirthm to process the file efficiently, and ultimately be able to report the top 10 N-URL-Sequences. A N-URL-sequence is a contiguous ordered series of N URLs that a customer hit. For instance, if customer 1 hits URLs A, B, C, and D, this forms the sequences A-B-C and B-C-D. Since the file is chronological, the data for two hits by the same customer may be seperated by a large distance, if enough other hits occur in the mean time.

I'm not going to go in to the algoirthm much (if you're googling for the answer, you owe it to yourself to figure it out), but my reference implementation is here: N-URL-Sequences