This puzzle challenge brings joy to the world of code

On December 1, 2015, at midnight, when Eric Wastl first launched his annual Santa-themed daily puzzle programming challenge. The advent of code, 81 people had registered. This was roughly in line with its capacity planning for 70 participants. Wastl figured that this fun might interest a few friends, some friends of friends, and maybe some of their friends as well.

But Wastl, a software engineer who works as a senior architect for TCGPlayer, an online marketplace for collectible card games, hadn’t anticipated how the recursive contagion of social media could exceed those modest expectations. He jokes that the technical term for what happened next is, “OH NO! In 12 hours, there were about 4,000 participants. The server almost crashed. At 48 hours, there were 15,000 people, and by the end of the event, on December 25, the grand total was 52,000. The following year, he transferred the operation to Amazon Web Services, and the numbers have since continued to rise.

Last year, possibly due to the pandemic, the event saw a 50% increase in traffic, with more than 180,000 attendees worldwide.

And now again this year, thousands of coders from San Francisco to Slovenia, students, software engineers and competitive programmers, are counting down to Christmas with Advent of Code (AoC). While traditional Advent calendars offer daily gifts of chocolate or toys (and some alternative versions deliver dog treats, Jack Daniel’s figures, Lego or even digital delicacies via apps), Advent of Coders playfully unpacks math problems, then writes computer mini-programs that solve them.

The fun, in part, is simply in the age-old magic of a holiday ritual. But it is also submitting to a pleasant perplexity. Peter Norvig, director of research at Google, finds it funny because he trusts the creator, Wastl, “to make it worth it” – similarly, says Norvig, to the way the New York Times trust Will Shortz to do the right thing. by them. “There will be a few tricks that will make it interesting,” Norvig says, “but there are limits on the difficulty.”

The pleasure of coding

At midnight US Eastern Time (Wastl is based in Buffalo, New York), every night from December 1 to 25, a new puzzle lights up at adventofcode.com, embedded in a cleverly composed Christmas caper tale – one player described the story as “a Plot of apologies if there ever was such a thing.

This year’s event got off to a good start when Santa’s elves lost the keys to the sleigh. The first problem set the scene like this: “You are minding your business on a ship at sea when the overflow alarm goes off!” You rush to see if you can help. Apparently one of the Elves tripped and accidentally threw the keys to the sleigh into the ocean!

Fortunately, the Elves had a submarine on hand for such emergencies, and from there the participants embarked on a 25-day underwater quest. They try to solve two puzzles per day (the second adds a twist, or more difficulty), each worth a star and some praise: “That’s the correct answer! You are a gold star closer to finding the keys to the sleigh.

Each player gets a star for solving a problem, but if you are the first to get a star, you get 100 points; if you are second, you receive 99 points; and so on, 10th place earning a point.

“To save Christmas,” explains the puzzle master, “you will need to get all fifty stars by December 25.”

santa hat ascii

MS TECH | THE ADVENT OF THE CODE

The object of Advent of Code is to solve the puzzles using the programming language of your choice (Python is the most popular). Participants also use crochet or crook strategies, such as “Excel Madness,” as Wastl describes, or reams of graph paper, and a surprising number solve Minecraft puzzles.

But the broader motivation varies from player to player. Some see it as an annual refresher of their programming skills; others see it as the perfect opportunity to learn to code or try a new language. José Valim, creator of the Elixir programming language, broadcasts his AoC live solutions on Twitch.

On top of the world ranking, who ranks the 100 players with the highest total score, competitive programmers like Brian Chen (his nickname is “betaveros”) and Andrew He (“ecnerwala”) are out for speed. A security software engineer working on end-to-end encryption at Zoom, Chen was first last year (and the year before), while he was close second.

“Going fast is fun,” Chen says, “as is optimizing anything that gets you pretty immediate feedback. There are a lot of little knobs to adjust, and a lot of little moments to be proud of where you made the right choice or prepared something that came in handy.

Chen and He, both MIT computer science graduates who live in the Bay Area, are friendly rivals who have faced each other in programming challenges over the years – on the same team at International college programming competition (ICPC) and as competitors to Codeforces and Google Jam Code. This year again, Chen beats He. “To be honest it’s because he’s a little better than me” – better at various tricks and implementations that optimize speed – “but I don’t like to admit it,” says He, founding engineer of the startup Modal, which builds infrastructure and tools for data teams.

The ranking is out of reach for the majority of participants, especially as the puzzles get more and more difficult day by day. Kathryn Tang, who leads an engineering operations team at Shopify, ranked 36th on day one and 81st on day three, but knew her leadership status wouldn’t last long. “I’m doing this for fun using Google Sheets,” she says.

The contest element, however, is replicated – at Shopify and Google and many businesses large and small – with private rankings, as well as dedicated chat channels where players share solutions and review issues during autopsies. .

“Competitiveness helps engagement,” engineer Alec Brickner said, commenting on a Slack channel to Primer.ai, a natural language processing startup in San Francisco (Brickner made the rankings over a few days until here).

“Meh,” replied his colleague Michael Leikam. “The reward for me is the joy of coding. “

John Bohannon, Scientific Director of Primer, backed this up with an emoji: “SAME. “

Bohannon also likes the silly story that poses the problems, but the plot is of little to no use. “Speed-demon solvers ignore the story altogether, focusing on the variables of the problem at hand and just getting there,” he says.

Nora Petrova, data scientist and engineer at Primer’s London, UK office, is here for beauty, not sport: “I love the drama that unfolds in every puzzle,” she says. For example, on the fourth day a giant squid got attached to the submarine – of course he wanted to play bingo. The entry to the puzzle was a random set of 100 bingo boards, and the challenge was to predict the winning board and give it to the squid.

To like OR EXCLUSIVE The hate

Wastl’s main motivation in creating Advent of Code was to help people become better programmers. “Newbies who get into programming are the people I want to get the most out of,” he says. “The measure of success for most people should be ‘How many new things have I learned?’ – not ‘Was I one of the fastest people in the world to solve this puzzle?’ “

Russell Helmstedter, a college professor at the De Anza Academy of Technology and the Arts in Ventura, Calif., Uses Advent of Code to teach Python to his sixth, seventh and eighth graders. They discussed the first two issues together in class. From a teaching point of view, problems are effective exercises because if you fail you can just try again, very much in the spirit of test-driven software development.

Helmstedter found that some of his students were a bit overwhelmed with the two-pronged challenge – decipher the problem and code a machine to solve it – but most embraced the struggle. “I like that it is difficult to do,” said one student in a poll. And another said, “Honestly, there is no downside. I really like the way you start to gradually work towards a goal. Although the ranking of the survey’s multiple-choice questions “seems” elicited an “I hate it”, 41 respondents chose “I like it” (to varying degrees) and eight “I love it”. “

reindeer ascii

MS TECH | THE ADVENT OF THE CODE

At the University of Ljubljana, Slovenia, computer scientist Janez Demšar uses AoC problems both as a teacher and to hone his own skills (he is part of the core team of Orange, an open source machine learning and data visualization toolkit). “I need to have a regular practice, like a violinist who plays in an orchestra and teaches but still needs small pieces to practice,” he says. “So these are my studies. Demšar teaches programming 101 to a heterogeneous group of over 200 students. “My biggest concern,” he says, “is how to keep those who already know some (or a lot) of the programming interested and occupied. AoC tasks are great because they require a variety of skills, ”from pure coding to algorithms.

Gregor Kikelj, a third-year math student in college, first tried Advent of Code in 2019. He was successful enough to land an internship at Comma.ai (working on Openpilot, his software for systems semi-automatic driving), since the founder of the company was also in competition. And Kikelj improved his grade in the programming class (along with another teacher), as each problem solved was worth additional points on the final exam, as well as bonus points for being placed in the leaderboard.

Kikelj (“grekiki”) would get up every morning to throw the puzzle – 6 am in Slovenia – and placed 52nd overall, accumulating a total of 23 extra exam points. “After that year, they capped the number of points you can get at 5,” he recalls. But he always rises with the sun to pounce on the puzzle. This year his best ranking, on day five, was 25th – he aims to stay in the top 100. “We’ll see how that plays out as the issues get more difficult,” Kikelj said.

How to rank

If the leaderboard is your game, the competition is fierce and the daily countdown is key – players wait like a hawk for the puzzle to fall, then click lickety-split to download. Last year, this “giant, one-second sync traffic explosion” (as Wastl describes) even confused Amazon’s load balancers.

the AoC Subreddit– one of the many communities on the internet – is full of jokes inside baseball about how to take it (with solutions and help threads, as well as auto-satire and memes). But perhaps the best resource is Brian Chen’s blog post on “how to rank. “

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Trending this Week