Just completed the programming test. In some sense it was easier than I expected but the test was a little open so i am sure they are more interested in the methods used than the fact that I have a solution.
For those interested, if you know the game boogle, the problem was to find which boogle board (in this case a 5x5 grid of letters) produces the best score (longer words score more points). Being that there are 26^25 different possibilities, exhaustive search was out of the question. One of the key components was a very fast method to check a word is in the dictionary (and a string is a substring of a word int he dictionary)- for this I used a Trie tree structure. I don't want to give details on my search method but it involved combining global and local search behaviors with some heuristics.
I had the base version in a day, spent the next day optimizing/improving, the 3rd day tweaking/cleaning/documenting code, I then ran the search algorithm for a few hours and found a board with ~2500 words and over 10K points.
Can you expand a bit on this?
I can think of a couple of fast algorithms to evaluate what score a particular "realization" of the board is.
Trying to find the best possible score however seems quite hard.
The only thing I can really think of doing is starting from an initial realization then keep making "best possible" incremental changes until the board reaches a local optimum.
Calculating new scores from incremental changes should be fairly cheap.
Then take plenty of initial realizations to try and span the "board space" and select the best local optimum you know as a global optimum.
Inside this method though there is a parameter, how many one letter changes to the board to allow in an "incremental step", more letters probably equals better local optimums but at a bigger computational cost.
I guess the best parameter depends on the distribution of length of words in the dictionary.
You could also try and tree the incremental changes, taking the best "n" changes and progressing all of them. Again not sure how to select this parameter, maybe just take all increments which improve the score?
I'm not sure how well this would work but I am struggling to think of anything better?