Google Code Jam 2011

The Googlers are spending their 20% time to get ready for Google Code Jam 2011, preparing algorithmic problems for the 10,000 or more contestants who we expect to compete in our Qualification Round this Friday.

A good Code Jam problem has a story to ground it in some version of reality: soccer, ninja and messages from alien cultures have all served admirably. Cushioned by the story, the core of a Code Jam problem is an algorithmic puzzle whose solution needs anything from a few lines of code to a deep understanding of flow algorithms or number theory.

The ninja in the middle is solidly grounded in reality.

Anyone at Google can create Code Jam problems, which means that our methods for inventing them vary wildly. One author might come across a real-life situation, think about what algorithm would solve it, and base a problem on that; another author might think about how to make a problem out of a video game. Sometimes a problem author will start with an algorithm and concoct a problem that it solves. We also really seem to like inventing weird situations on chess boards.

With the story and the problem chosen, our work is only partly done. The problem has to be stated in such a way that it will be clear, even for an audience from 125 countries. At least three engineers work on each problem’s statement: that group includes at least one native English speaker to make sure the grammar is all correct, and at least one non-native English speaker to make sure the language is clear enough.

The toughest part about setting up a problem like this is verifying that contestants got it right. In Code Jam, we do that by providing contestants with an input file full of test data. They send back their program’s output, which should be the answer to the input file’s question. The hard part is deciding what goes in that input file: we need edge cases, plenty of average cases, and a good number of cases that make sure the contestant’s code is fast enough. To create all of those, we generate some cases by hand and others pseudo-randomly. We’ve been known to generate a test case or two out of ASCII art, or as a creative-writing exercise.

Finally, we solve the problems ourselves. We require at least three solutions made by different engineers, and sometimes we have those engineers write solutions that we know to be wrong – just to make sure our test data catches them out.

The end result of this process is the kind of problem we’re proud to ask our contestants to solve. In 2011 more than any other year, we’re excited about the creativity of our colleagues and the problems we’re planning to pose. We hope you’ll enjoy the problems from the other side – and if you’re a great software engineer, maybe come help us write them in 2012.

You can register for Google Code Jam 2011 at http://code.google.com/codejam, and you’ll see the first problems of the year in the Qualification Round this Friday, May 6, starting at 23:00 UTC. For even more details about how we get problems ready for Code Jam, you can read our official problem-preparation guide.
Bartholomew Furrow spends 80% of his time at Google finding ways to eliminate bad search ads, and the rest on Code Jam. Programming contests introduced him to Computer Science, to Google, and to his wife.

Plant trees for change with Nobel Prize winner Wangari Maathai

(Cross-posted on the Official Google Blog)
Occasionally, we invite distinguished guests to contribute to our blogs and we’re very happy to have Wangari Maathai share her perspective here. In collaboration with Wangari Maathai’s Green Belt Movement and several other partners, the Google Earth Outreach team has created several narrated tours on the topic of climate change in preparation for the UNFCCC’s COP16 Climate Summit 2010 in Cancun, Mexico. Fly underwater to learn about the effects of ocean acidification on sea life with Oceana. Zoom around Mexican mangroves in 3D and learn about the importance of this biodiverse habitat… and what must be done to protect it for future generations. Visit google.com/landing/cop16/climatetours.html to experience these tours. -Ed.

Ask most people what trees mean to them and the first thing that comes to mind is the tree outside their bedroom window or the forest where they played as a child. Trees do occupy a powerful place in our emotions, but the most powerful argument to protect our world’s trees is not based on sentiment. There is a vital interdependency between communities and the trees they rely on for survival. Trees are our watersheds, protectors of the natural environment, and sources of food. Remove the trees from the equation and the community feels the impact.

I came to this realization in the 1970s in Kenya. I was talking to women in my community about their problems: hunger, access to water, poverty, wood fuel. I saw a link between their needs and the condition of the land and thought, “Why not plant trees to address these issues?” Trees hold the soil to the ground so that we can grow food in it, they protect watersheds and facilitate harvesting of rain water, fruits trees supplement food and trees give us domestic energy and wood with which to build our shelters. So while still working at the University of Nairobi, I established a tree nursery in my backyard, planted seven trees at a public park and founded the Green Belt Movement. The organization works to empower communities, to build their capacity to restore Africa’s forests and put an end to the problems that deforestation and other forms of environmental degradation cause. As a result of this idea, more than 40 million trees have been planted to restore the environment and improve the lives of the people who are linked to the land.

When we were offered a unique opportunity to partner with the Google Earth Outreach team on a project using new Google Earth technology to visualize trees in 3D, we were thrilled. For accuracy and integrity we worked very closely with Google, advising them on the modeling of unique African trees like the broad-leaved Croton, the Nile tulip tree and the East African Cordia. These tree models illustrate the biodiversity in our tree planting sites, especially in the forests, and how we carefully select trees that are indigenous and sustainable to the natural surroundings.

Broad-leaved Croton, the Nile tulip tree and the East African Cordia (from left to right)


We then used data from real planting locations to “plant” the tree models in Google Earth and create 3D visualizations. Now, for the first time in Google Earth, people from all over the world will be able to virtually visit these planting sites, explore the 3D trees and connect with the work that we are doing.

Green Belt Movement planting site in 3D on Google Earth


Tree planting is a simple activity with tangible results, and anyone can participate. It helps people come together to address common problems and work collectively towards community improvement and sustainability. I hope that seeing our beautiful tree planting sites in 3D on Google Earth will be a source of inspiration for people to engage, plant trees and organize planting activities in their own communities. Taking charge of our lives and the environment around us can help ensure a lasting legacy and healthy future for our children.

Learn more about the Green Belt Movement and support our work at http://www.greenbeltmovement.org.