Skip to main content

GSOC/Code pre courses

 Google Summer of Code and Google Code Jam are two different competitions organized by Google focusing on two different aspects of Computer Science which are Application Development and Algorithmic Problem Solving. Having said that strategies for both of them are completely different.


Google Code Jam is a series of online algorithmic coding rounds where you are given few problems to solve in a time constraint of 2-3 hrs. These problems are designed to test your skills in algorithms and data structures. The problems are similar to problems on various online competitive programming websites like Codeforces, TopCoder, Uva,Spoj, HackerRank and Codechef. The solution to these problems are standalone programs which are tested against input test cases and their corresponding output values. Facebook Hacker Cup and ACM-ICPC are other prestigious competitive programming competitions on the same lines.


Strategy for Google Code Jam -

TL;DR - Practice. Analyse. Optimize. Repeat.


1) Develop skill to read the problem statement precisely. Not once, but reading the problem for couple of times till you understand it completely. This is the fundamental basic foundation for solving the problem.


2) Think of a solution, analyse whether it is the best possible solution for the problem, design it on paper and only then start coding for the problems.


3) Relate it to the problem you have previously solved while practicing on other platforms. Figure out what is same and what are the elements which are different in this new problem. Not for easy problems. With time you will know when paper is not needed, but it is essential for quickly solving the problem.


4) Don't re invent the wheel. All the standard data structures to implement any kind of algorithm are present in the standard library of a programming language. For C++, STL is your best friend. Use it as much as you can, the api, the arguments, everything should be on your finger tips. You shouldn't have the need to refer to it during the competition. So practice a lot with it. Also know the limitations and time complexities of the data structures and algorithms present in the library.


5) Pay attention to detail. Its the most crucial part to succeed in competitive programming. Problem statement has details to what will be the input to problem. The size of input and its range. These are very important factors which make you decide to go with which algorithm or use which data structure to solve the problem.


The above points are the key to develop a strong foundation for algorithmic programming. All great programmers have mastered them practice, practice and more practice. So you are up against them in Google Code Jam. So let's see some more practices which are to be followed in your journey towards becoming a better competitive programmer. I will tell you about what they are good at and what they do to improve.


a) They know before coding whether the solution is going to work or not. Theoretical knowledge of algorithms and data structures which involves finding out time complexity of an algorithm you write. These depends on the test cases and the time specified in which your solution should solve the test cases. e.g. If input case is 10 to power 7, then calculate is your solution good enough and will solve problem in 1 sec.


b) Study better solutions. Don't be satisfied with your solution if it passes the test cases. Look at other better approaches to the same problem out there. This will give you direction as well as beauty of the thinking process of other superior programmers out there. Read tutorials for the competition your participate in very thoroughly.


c) Define your own macros. While you will browse the solution of other programmers you will be stunned to see very cryptic code some times. There will be a long list of macros defined at the start of the program. These vary from programmer to programmer. Create one for yourself or make use of some standard ones. Initially it takes time to use them but once you are used to it, you will code the solution much faster than before.


I think I have covered all I had to share from my experience. Algorithms are one of the most interesting fields in computer science so if you like it, keep it going and practice more, keep participating in competitions held on codeforces. Give time to it. It takes time to reach a level of expertise. To improve after a certain level will look very difficult, that will be the time when you will be frustrated but only more practice will get you above it.


Google Summer of Code is a summer program where Google sponsors you to write code for open source projects. It has a different journey all together. It involves understanding projects, reading loads of code, finding bugs and solving them, learning how to use different tools, using version control systems to share code with others, and an application process which decides whether you get selected for GSOC or not. Its not a standalone program anymore, its millions of lines of code and you writing code in middle somewhere. This is also a different kind of problem solving, but related to open source software and tools.