What is uHunt

uHunt is my personal (self-financed) project. It is a tool that helps me (and others) to find interesting algorithm problems to solve at UVa Online Judge as well as keeping statistics of the currently solved problems. uHunt also exposes web API for other web developers that are interested in querying UVa submissions data and build their own tools.

How uHunt was invented

I love solving programming contest (algorithm) problems. Back at year 2000, the only authoritative Online Judge that hosts good quality of past programming contest problems was the UVa Online Judge. However, as a newbie at that time, I was confused and frustrated in picking the next problem to solve. I want the next problem to match my current skill (i.e, not too hard). That was what triggered me to build a tool (a website) to organize the problems according to the difficulty level. At that time I only use the tool for myself, but over time, people around the world began to recognize the website and started using it.

How uHunt evolved over time (development challenges)

I keep using the tool myself and improve it bit by bit whenever I have spare time. Along the way, I learned a few web programming technologies like HTML, Javascript, PHP, MySQL. However, as the number of concurrent users accessing the website grows to more than 100 per day, the (shared) server began to crumble. This is because the tool requires high interactivity. It tries to display the most up-to-date statistics and provide chat functionality for small discussions. The Apache web server was not good enough to handle such workload. Fortunately, a new platform emerged (node.js) that solved the c10k problem which allows a regular server to handle thousands of concurrent clients with far smaller memory footprint. This was the perfect platform to switch to. Building uHunt as a node.js application was easy as it uses Javascript which I'm familiar about. However, there was another problem, the database (MySQL) was also beginning to crumble as the number of rows in the submission table went close to 10 millions (UVa OJ has that many submissions and growing). The time to update/maintain the indexes is so high that it increases the latency (responsiveness) of the website. I began to search for new database technology and stumbled upon a new exciting adaptive indexing technology called Database Cracking. It was perfect for my needs as it can process a large amount of tuples with low latency for each individual query. Moreover, it quickly gets faster (adapt) as more queries are performed! I built my own version of the Database Cracking using C++ and connect it to my node.js application. Since then, uHunt has been running fast and attracting even more users (reaching 200+ concurrent users per day). Thanks to the UVa admin for granting uHunt a direct database access which allows uHunt to have a timely response to user submissions. With these powerful technologies, it does scale well and allows me to expose uHunt as a web API for other tools to build upon. The web API is like a JSON data feed that can be used by other web developers who are interested in building variety of other tools for UVa OJ such as virtual contests, custom ranklists, or any other statistical tools.