WordLadder Coding Challenge

Recently a co-worker of mine was interviewing with a large internet retailer of some Brazillian-jungle influence, and was asked to write a word ladder application in Java using a given dictionary. The object of the application was to find the shortest transform path from word A to word B using one-letter word-variants. For example to get from “load” to “bald” the ladder would look like this:

load -> lord -> lard -> bard -> bald

After going over the basic restrictions I decided it would be fun to launch a code challenge to my readers. After JavaScript, PHP is my language of choice, so I set out to code up an example of what this WordLadder might be. Of course, to keep in in queue with the AJAX tone of this site, I made the interface all pretty with prototype.js and scriptaculous.So here’s the challenge: I want to see your best efforts in creating this application using your language of choice. Here are the requirements:

  • It must use the same dictionary file I use. (Click here to download this dictionary file)
  • It must find the SHORTEST path, not just any path
  • It must be web-accessible. So if you write it in C, you must have a way of calling it through a web interface.
  • It must be usably fast.
  • It must be able to handle up to 5-letter words. If you go over that and it’s usable then you get bonus points.
  • For more bonus points, make a slick interface to it using Ajax (any framework you want)

Of course there’s no real reward to the challenge other than a kudos to you for exercising your mind :)

Click here to see my working example

This entry was posted in AJAX, Development, Fun & Games, PHP. Bookmark the permalink.

3 Responses to WordLadder Coding Challenge

  1. Beau says:

    Very nice, and very fast! :)

  2. Ryan Byrd says:

    Definitions:

    Recently a co-worker of mine: Burdette

    a large internet retailer of some Brazillian-jungle influence: Amazon.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">