« Kata Thirteen: Counting Code Lines | Main | Kata Eleven - Sorting it Out »

January 28, 2007

Kata Twelve: Best Sellers

Consider the implementation of a top-ten best sellers list for a high volume web store.

A GedankenKata this week: no code needed (although writing short prototypes might help you come to a conclusion).

Say you’re writing code for an online site that sells things (something like Amazon). Your site is wildly popular, and you sell millions of items each day.

The marketing department wants the home page to display a top-ten list of the best selling items over the last 24 hours, with the list being updated each hour.

  • How would you implement this?
  • Are there any changes you could ask for to make the implementation easier?
  • What would be the impact if they later came back and said:
    • only update the list once per day; or
    • we need the list updated in real time: each time the home page is displayed we need the list to reflect the 24 hours up until that point.

This kata might be deeper than it first appears. You might want to consider database vs. in-memory solutions, data structures that allow aging, time-space tradeoffs, and the like.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83451c41c69e200d8353d46b553ef

Listed below are links to weblogs that reference Kata Twelve: Best Sellers:

Comments

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment