Showing posts with label tcs. Show all posts
Showing posts with label tcs. Show all posts

Tuesday, August 6, 2013

CodeVita 2K12 – A 1-2-4 Experience

Hello Friends,

This is Ashutosh, Absar and Nikita from ABES Engineering College, Ghaziabad. We were the third runner-ups in the very first edition of CodeVita.

Here we are with our wonderful journey of CodeVita – 2K12.

CodeVita, one of its kind contest, was announced by TCS last year for the first time. When we got a promotional mail through the campus commune portal, we were quite excited to know about the details and waited eagerly for it. Finally the dates were announced and the registrations started.

Team Formation:

The team formation in our case was quite interesting. It was just a matter of some phone calls which brought us altogether. Before that we had never thought of being in a team. Finally we were a team.
Though we had participated in many inter-college competitions individually but it was the first online competition for us. The scenario is different in case of online competition where your code is tested against an online judge. It was a new thing for us and the practice round helped us a lot to know what exactly the platform was and how did we need to code. The advantage with our team was that we all knew to code in both C as well as Java, though we preferred Java.

After the registrations were over the dates for the different rounds were announced. Seeing the huge number of registrations we were little bit nervous.

Round 1:

This was an online round where you need to code from your place. There were five problems and we had a time slot of 6 hours to solve them. The questions were labelled as Easy, Medium and Hard. When we had a first look at the questions, we thought those could be solved easily. But the real fun began when we solved the very first question and uploaded it to end up with a “Wrong Answer”. It was then we realized that we had missed on something. We once again read the question properly and analysed it to find certain test cases on our own especially the boundary cases. Then we worked accordingly and now with more confidence uploaded the question. To our disappointment this time we got a “Time Limit Exceeded” error. Now we realized that we really need to optimize the code and a very general approach (brute-force was what we were trying) would not suffice. Later on after some optimizations we uploaded the code and finally got “Accepted” status for our first code.

At this stage, we realized that things were not as easy as we thought them to be and we continued to code the further questions by dividing our work for the problems and having discussions on the approach as and when needed.

Finally at the end of our 6 hour slot, we had successfully solved 4 problems. We were quite relaxed but we had no idea about whether we would be selected for the further rounds.
The results were to be announced after 2-3 days. We were waiting for the results. As the results were announced, we received a mail saying that we had been moved to the second round. We were too happy but had a very little idea about our rank. To our surprise, we were on the top of the list in the first round.

It was now the time for round 2 which was after 4-5 days. We had started preparing for it from some online coding sites and solved many problems. Finally the day came.

Round 2:

Here again there were five problems as in round 1, but obviously the level of questions was better than that of round 1.
We did not repeat the same mistakes of round 1 and solved the first question quite fast. Now it was the time for the other questions which were little bit tough. Finally we ended up with solving 3 questions correctly and 1 question was almost done with some small error.
Since we had solved just three questions and competition was tough, we were disappointed by our performance and had left all our hopes for the finale.
When the results were announced we were one of the top 10 teams which were selected for the finals. We were surprised to know that and finally we were ready to go for the finale at TCS Sahyadri Park, Pune.

Final Round:

This was the toughest of all rounds and we had 9 questions to be solved in the same duration of 6 hours as in the previous rounds. It was very different from the previous rounds and the competitive environment with all the participants around us busy in coding made it more challenging. On the top of that, the challenge was increased when we were told about the live relay of codes to an audience in a different seminar hall.
After a long brainstorming session, finally the time was over and we were waiting for the results to be announced. We were happy to know that we were at the fourth place. Though we could not perform to meet our expectations but still we were satisfied.
We were awarded Provisional Job Offer Letter, Internship Offer with TCS R&D, IEEE Student Membership and a digital photo frame.

After CodeVita:

CodeVita was a great experience for us which involved a lot of fun and learning (and of course coding). It helped us to gain confidence and thus we participated in many online competitions on CodeChef and HackerRank which is still continuing.
We all have now completed our B.Tech(CSE). Absar and Nikita are now a part of TCS family and I am continuing my further studies (M.Tech CSE @IIT Guwahati).

We are thankful to TCS for organising such a great event and also to Mr. Amol Khanapurkar who provided us this opportunity to share our experience.

Now its time for the second edition of the event which is being conducted at a much larger scale. If you have little interest in coding you should surely give it a shot. It’s a wonderful opportunity which should not be missed in any case.

The experience makes us to wish that we could be one of the participants in this edition too.

Few Guidelines:

  1. Read the problem carefully and consider all the cases (even the worst ones you can think of).
  2. File handling, Error handling, I/O operations and Input validations are the areas you should be comfortable with.
  3. Avoid wasting time searching for the solutions of the questions on internet. Rather try to work out on your own and write your own code.
  4. Plagiarism is prohibited, so don’t share you code even with your best friend as it may land up both of you in trouble and may even lead to disqualification.
  5. Use the same version of compilers as specified as those will be used on the online judge irrespective of the version you are using.
  6. Never be in hurry and don’t panic. Stay calm while solving the problems.

All the Best for CodeVita’13!!!


KEEP CODING !!!

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.