Thursday, August 1, 2013

A wonderful journey called CodeVita!

Hello friends and fellow coders,

We are the team of Apaar Gupta, Ambuj pandey and Amal Srivastava from previous year’s edition of  CodeVita. And here we take the opportunity to share our experience with you all.

Our team did good in the previous year’s CodeVita. We stood 6th in the first round, topped the second round and were finally the second runner ups in the final round.

Preparation:
We were introduced to programming, rather inspired for it by looking at our seniors who used to participate in online contests and were winning accolades. We got in touch with them and started our own programming on online sites. Till this date we can’t clearly recall how we three bumped into each other and formed a team, but we have been a team ever since.

Earlier we were just some Computer Science guys who thought they have a knack of programming and can code well. But, lo and behold, we were introduced to a whole new world of algorithms, data structures, rules, constraints and what not. But gradually we got a hold of it. We even cleared the first round of ACM-International Collegiate Programming Contest (ICPC) 2011.

Our Journey:
Frankly speaking, we weren’t excited enough in the very beginning (as it was happening for the first time) and our expectations were not that high. It was after the first round that we scored the sixth position; there on we started getting vibes that if we put some efforts, this contest can be a game changer. And it did!  The second round will be particularly a memorable one to us. Especially the journey from a 30+ rank to 1st within last 1 hour is unforgettable. We can write an altogether different blog article to express our emotions about it.

Finally, in the third round, we were invited to TCS Pune Sahyadri Park Campus. The high-tech campus amidst lush green mountains melts your heart in the very first sight. It’s easy to fantasize yourself along with your laptop onto the grasses.  Anyway, the questions here were a bit more challenging in terms of test-cases. Even the easier ones had pit-falls and most submissions resulted in Time Limit Exceeded (TLE) and Wrong Answer(WA).

Experiences from CodeVita:
Prior to CodeVita, we were already  familiar with some online programming contests, having participated in some of them on CodeChef, TopCoder etc. We had also cleared the first round of ACM ICPC in 2011 (and subsequently in 2012).

But CodeVita was different, different in many aspects. Here we found that having core knowledge is not sufficient, you need to write a well rounded code that is impregnable and can’t be broken.

Tips to fellow coders/juniors/newbies:

1. Know your compiler:
The knowledge of which compiler is to be used is essential. Your compiler must match the one used by CodeVita. For C/C++ users who still use Turbo C, beware. CodeVita uses GCC compiler for C/C++ (and so does all others). It’s sad to see that many colleges still use Turbo C/C++ as their default compiler in their labs. They still think that the size of an int is 2 bytes!

Preferably use an IDE like CodeBlocks for C/C++ and Netbeans/Eclipse for Java. Also, it is advisable to prepare a template before attempting to code during the match.

2. Beware of Invalid Inputs and Corner Cases:
Your code might be tested against a plethora of invalid and random inputs. So you must put checks against them at all times, and prevent your code from breaking down. Watch out for corner cases every time before you design your solution.

For instance in Round 2 there was a problem on Income Tax calculation, it was “crazy” (we read that as whimsically clever) to create and test sample input and run them on an Online-IT simulator website and matching the results with our own. Crazy, aren’t we?

3. Know a bit about complexities:
Time complexity does play a vital role sometimes in deciding you solution. The first year students (FY16) might not be aware about it at all.

For example, there was a problem of finding primes up to a given number n that appeared in the first round. There the maximum limit of n was 1000. So any naive solution could pass. But the same question appeared in the second round too, but with the limits raised to 1000000. Now, the same code won’t run here (Time Limit Exceeded). So specialized methods are required (like Sieve etc).

Remember, your code can’t run forever.

4. Adhere to the output format strictly:
Do as is directed in the statement, print the answers as it is, print new lines (\n) wherever required, and no other characters at all. Not even an extra space here and there, as it could lead up to Presentation Errors (like previous year).

Some general tips:
5. Team effort:
At times like these, you aren’t judged on your personal intelligence/knowledge. What counts is the team’s glory. Understanding yours and others, weak and strong areas are an important factor.

As in our case, for instance, we were pretty clear if a problem on Strings and File Handling came across, it would be done by a specific member. Similarly if it’s an ad-hoc, the other one would take charge.

6. Strategize!
Unlike ICPC, here we are given three machines (one per member) in the on-site round. So, you can parallelise your work, such as three different coders working on three/two different problems. But remember, coding in the cozyness of your house is different from coding in the competitive environment setup of the on-site round. So prepare likewise.

Each problem is designated as Simple, Medium or Hard. Simple ones are mostly ad-hoc so you can solve them with ease (provided your grey matter is in good mood that day). Medium ones often look simple, but there are pitfalls that need be noted and acted upon. Hard ones expect some significant pen-paper minutes, so be prepared when you try attempting them.

7. Written materials:
Some problems are directly based on classical problems. You can carry a Introduction to Algorithms by Cormen for quick reference on the onsite round as they are allowed but do remember; any online help is strictly frowned upon and may lead to disqualification.

Winning and Aftermath:
The rewards from TCS were abundant. We were offered a provisional offer letter, an internship letter, an Amazon Kindle each (1st and 2nd rankers got iPad and Galaxy tabs) and an IEEE Student Membership. Now, having completed our B.E. we are about to join TCS very soon. And we’re very excited about it.

For us, the post CodeVita experience has been a wonderful one. CodeVita2k12 has brought us up to the strata amongst peers now that it provided us a significant social recognition. We were awarded in our college by every senior personality, and many treats and parties followed. The addiction for programming was revitalized by this feat and we also participated in programming events at IIT-Kanpur and also with IEEEXtreme.


Programming is weird thing to do. First you indulge in it, then face a sea full of obstacles like WA, TLE or Compile Error, but believe us, there is a *bliss* moment when your code runs after those brain wrecking times. Relish the ecstasy in CodeVita 2013. Keep calm, keep programming.


No comments:

Post a Comment