Share & Connect
Quick question: ‘How do programmers code’? Quote from Jack G. Ganssle, “Writing code is fun. It’s satisfying. We feel we’re making progress on the project. Our bosses, all too often unskilled in the nuances of building firmware, look on approvingly, smiling that we’re clearly accomplishing something worthwhile.”
Welcome to the IEEEXtreme 24-hour programming contest. It’s a global tournament where teams pit wits and energy against the clock to solve the highest number of problems. This year was the sixth annual event, and saw a record number of entries – over 1900 teams. Problems were released every hour, with a total of 20 problems released at the end of the 24-hours. Code submissions were done on an online platform, InterviewStreet, where teams could also ask questions regarding the problems and check leader-board rankings. A variety of languages were allowed, such as C, C++, C#, Java, Python, PHP and Perl.
Some teams enter to win, others just for fun and experience. You could say my reasons were the latter. I’m no computer science geek, just a regular student in electrical engineering who did a bit (pun intended) of programming as part of my coursework. Being an IEEE student member, I received an invitation to participate in this competition, and I thought, ‘Why not?’. Alongside me were two post-grads, Billy and Alex, who had a thing for programming as well. We formed our plan – to solve as many questions as possible. Most teams probably had the same plan in mind.
The contest started on 20 October at UTC 00:00, which converted to 8am local time. As a team, we mused on the first question: (Summarised) “Calculate the number of bunnies alive after a year given an initial number of bunnies.” You were supposed to get 0 if the initial number was 444. It was short and looked deceptively easy. I was tasked to solve it while the other two worked on the incoming questions. Two hours later and it still wasn’t solved. Garenth, a lecturer and our designated fast-food delivery guy, strolled in with a couple of cheese cakes and cream puffs. A nice diversion to killing bunnies.
I spent another two hours on this question before I realized the organizers had closed it. The problem was flawed, apparently. It drew plenty of flak from participants worldwide who had, like me, spent hours trying to wipe out the bunny population.
Halfway through the tournament, the aim of our team was slowly changing. “Just solve one question, just one..” My mind wandered to a 9gag post: “My code doesn’t work. I have no idea why. My code works. I have no idea why.” Admittedly, the questions were really interesting, and you start out excited when setting out to solve it. But as you code, you slowly realize the enormity of the task, and when bug after bug appear, you yearn for your bed more than anything. The thing about unsolved code problems is that it stays with you all day – like an itch. You keep wondering why the wretched code won’t work.
My experience is bound not to reflect all the participating teams. Through InterviewStreet, you saw when other teams successfully solved a question. And the leader-board rankings told you which teams were leading the competition. You’d be working endlessly on a problem, while one team after another from around the world cracked it. After a while you’d start to wonder if you were the only dysfunctional team onboard.
Aside from minor question errors (though some teams may beg to differ) and a little downtime, the IEEEXtreme tournament was a well-organized tournament. It housed a total of 150,090 code submissions upon closure of the tournament. Statistics show that over 1900 teams of three, from 60 different countries participated in the contest, which means over 5700 students worldwide converged for 24-hours to solve programming questions.
At the end of the 24-hours, the unofficial leading team in the rankings was Team Vikings from Belgium, with a total of 14 questions solved. The IEEEXtreme Technical Team is currently evaluating code submissions, and the official winners will be announced come 1 November, 2012. The first prize is an all expenses paid trip to an IEEE Conference of the team’s choice.
Why do people code? The above quote by Ganssle tells us a little why people code. It’s fun and satisfying. And there is the status element to it. You impress your ‘unskilled’ friends by your knowledge of words and symbols that somehow have meaning and solves a problem. That aside, joining the IEEEXtreme Programming Contest was indeed a good experience, enhancing your programming depth and making you a little more knowledgeable on what’s buzzing in the field.
As a closure, here’s a sample of one of the questions from the tournament:
Detecting Shapes in a Bitmap
In image analysis, it is common to analyze a bitmap and observe the shapes present in it. For this problem, design an algorithm to detect shapes in a given bitmap. The shapes present in the map shall be from the set Square, Rectangle, Triangle and Parallelogram. In the bitmap each pixel is represented as a bit, 1 – representing black and 0 – representing white. Participants are expected to detect the shapes outlined in black.
The first line will contain the size of the bit map in pixels represented as (Row,Column).
E.g. 6,8 this means a bit map of 6 rows and 8 columns.
The next line will contain a series of decimal digits from 0 to 255 separated by spaces. Each digit will represent a collection of 8 binary bits in the bitmap. IE. 55 represents a binary pattern 00110111.
Note: There can be multiple shapes in a bitmap and NO shapes shall intersect. However there can be shapes nested with each other without any intersection.
The shapes present in the bitmap in ascending order of their names, separated by a comma and a space.
Eg. Rectangle, Square, Triangle
Note: There is NO linefeed or space at the end of the output
If any shape repeats, the output should contain as many repetitions as in the bitmap. ie. If there are 2 squares and one triangle, the output shall be Square, Square, Triangle
Example Set 1
0 126 66 66 126 0
Example Set 2
0 0 120 120 72 144 73 32 123 192 0 0
Image Courtesy of IEEEXtreme