Coding to Win

07 Jul 2021

Over 200 DSTA staff furthered their programming skills at Code Champion 2021 on 7 July 2021.

The third iteration of the competition – following Code Sprint 2019 and Code Champion 2016 – was held online and pitted individual participants against one another instead of in teams.

The competition consisted of five challenges that participants had to solve within nine hours. The challenges varied in difficulty, and ranged from simple mathematical problems to geometry and optimisation programming. Solutions could be coded in various programming languages including Python, Java, JavaScript and C++. Participants were awarded points based on speed and accuracy.

The challenges were a great opportunity to expose participants to useful algorithms that they may not have been be aware of otherwise. For example, the 'Island Block' challenge required contestants to use the convex hull algorithm, which has many applications such as data mining, Geographic Information Systems, and collision avoidance, among others.

210707_Code Champion_01

For the ‘Island Block’ challenge, participants had to calculate the shortest distance between A and B.

Another challenge ‘LOL LOL LOL’ was designed to inject some fun into the contest. Participants had to solve a series of questions using only LOLCODE, a “joke” language that has “no functional purpose other than for the LOLs”, according to intern Chrystal Quek from Cybersecurity Programme Centre. Most participants were unfamiliar with the language and had to learn it on the spot.

Chrystal, who was also the top scoring intern, added: “I felt stumped initially as I had to code in an unfamiliar language. But I tried my best to learn it online to solve the challenge. It’s amusing that this programming language exists.”

210707_Code Champion_02

A solution in LOLCODE submitted by a participant.

Senior Engineer (C3D) Pan Peining, who came in fifth, enjoyed solving the creative challenges in this year’s competition. She said: “Code Champion 2021 was interesting. The challenges were unexpected and tested your knowledge in different fields such as geometry.”

Event organiser Senior Principal Engineer (C3 Development) Linda Lee explained that it was a conscious decision to add new elements into the competition. She said: “Such coding competitions expose coders to new ways of solving problems, provide opportunities for experimentation and demonstrate how different codes behave.”

While the easier challenges did not trip up most of the participants, the challenges’ increasing difficulty meant that fewer participants were able to proceed to the medium and hard challenges.

In fact, only one person managed to solve the hardest challenge called 'Optimal Selection'. It required participants to propose a code that would help an engaged couple select the invitees for their wedding based on their friendship level, as the couple could only invite a specified number of guests.

Engineer (Cybersecurity) Benjamin Huang, who worked on his solution from “lunchtime to 4pm”, said the difficulty of the challenge lay in proposing a code that worked for all the considerations while being as efficient as possible.

210707_Code Champion_03

Engineer (Cybersecurity) Benjamin Huang finished first in the competition.

Attributing his success to a combination of luck and experience, he said: “I compete in coding competitions regularly and found 'Optimal Selection' similar to other problems I'd seen before. That helped me to apply the correct techniques to solve the challenge."

With the competition over, some of the participants are already looking forward to the next run.

Senior Engineer (Information) Low Weilin, who is in fourth place, said: “I enjoy coding competitions as the process of coming up with solutions within time constraints stretches my creativity.”

Peining, added: “Competitions are a fun way to train us to work under pressure, focus, and learn things on the fly. These skills are applicable to our work in DSTA as technology is constantly changing, and we have to quickly learn and understand how to adopt them to our work.”

BACK
TO TOP