Let me introduce to you my friend Archit Karandikar. I met him at Directi last summer, we were interns, since then we are good friends :). I was quite impressed with his skills. Many of us know that he is awesome at math and programming. Let me tell you, majority of the Indian programming community do not know him only because he does not take part in codechef long contests 😛
He is one of the best programmers from India and very few know this fact.
He won Bronze at IOI in the year 2010. ( Link )
He went to ACM ICPC World Finals twice. ( Team Name : Paradigm Shift, 2013 and 2014 )
His team was the best among Indian teams at ACM ICPC WFs 2014 ( Link )
He is consistent on Topcoder and Codeforces. I appreciate his accuracy and clean coding style.
If you take a look at his Topcoder profile, he did his first SRM in year 2006 and latest in year 2014. What else can be more motivating?. He chased his goals consistently. Look here, Archit holds the record for 17 consecutive rating increases. Brilliant 😀
I always liked the way he codes, it is very clean and neat. There was a time when I looked back at a problem, I did not understand my own code (10 statements in single line :P) but understood his code. It was from then I started to code clean.
I asked him to answer few questions. I tried my best to extract information that will help other programmers.
Thank you Archit for answering them all 🙂
Playing and following sports/games.
TV series and novels. (TV Series, Novels and e-games: very selective)
What do you do the most, apart from programming and sleeping.
Stuff mentioned above.
Try to do some workout (sports/running/gym) daily. (Although I have been irregular in the last 3 months)
[ I believe the importance of physical exertion is highly underrated. It is essential IMO, to anyone pursuing not just programming but any intellectual challenging activity for a prolonged period of time. ]
How good are you with other fields of computer science? Which fields?
Practical computer skills: basic, not very good.
But I wish I had developed these during my B.Tech. years. Some people who are much better than me: Prateek, Anish, Pulkit. I must now develop these skills (including shell-scripting, python/perl/PHP, the basics of networking, even Java).
You were at the world finals 2013, what did you think you missed then? What did you do next 12 months for world finals 2014?
We were very unprepared in terms of practice, algorithms and familiarity with the usual twists and tricks. But despite that we should have solved at least 4 problems. All of us got stuck on problem A, for which we came up with many wrong algorithms. We missed H and D which were doable. To sum it up, it was a disaster. Nearly everything went wrong.
In the last 1 year, we tried to practice on the following:
- 5-hr contests. ACM-ICPC regionals, past World Finals, Stankevich contests.
- Competitive programming contests – CF, TC, CodeChef, GCJ etc.
What is the first thing you do after reading a question?
Read the problem. Try to find a solution. If not successful, solve just the sample inputs. Try to find a solution. If not successful, come up with a general theme (DP/Greedy/Graph/Exhaustive Search). Find a solution. If not good enough, optimize using greedy observations. If not successful, look for some standard trick which is applicable. After this, the approach is different for each problem.
[ For most problems, no such structure is followed. With some practice, it is surprising how little the time difference between reading the problem and finding the solution can be. ]
Once you get the solution to a problem and ready to code, do you try to simplify coding by working around on paper? Or any other method you use?
Depends on the difficulty. I do manual runs for hard-to-code problems. I find that they are very helpful in avoiding mistakes and actually end up saving a lot of time.
In team contests, work on paper plays a much more important role than in individual contests. By participating in team contests, I have learnt (to an extent) to do work / pseudo-code / planning on paper so as to minimize the time that I use the PC.
I noticed that your accuracy is very good, want to share anything regarding that?
You may also have noticed that my speed is slower than other coders with rating similar to mine. Its a trade-off between accuracy and speed. I prefer to be completely sure of the solution before I start coding. I check my code once before compiling and once before submitting. This, I believe is a a good coding habit in general, but is not always useful in individual contests, esp. for the not-so-hard problems. This is both the reason for my relatively slow speed and relatively high accuracy.
What coding habits helped you perform better?
Writing structured and easy to read code. (Pseudo)Coding on paper. Writing modular code. Of course, there is a LOT of scope for improvement in each of these areas.
If you were sure about your code but got WA upon submitting, what do you do?
I have noticed certain patterns which cause surprising WAs. Some of these are:
- Memory refreshing problems.
- Declaring ints as chars.
- Long long errors
- Wrong array limits.
- For loop limit errors.
several others not mentioned above.
I see whether any one of these is applicable. If not, I try to come up with a counter-example to my algorithm.
What do you think your team missed at world finals 2014? (Or was everything perfect?)
For about 293 minutes, we were struggling in despair. 1 minute went perfectly. We did nothing for the last 6 minutes. So of course, we did a lot of things wrong.
Our coding should have been faster. We should have discussed implementation for problem K before coding it. I should have wasted less time on K at the start of the contest and switched to D earlier. I was affected by pressure when coding C and made a lot of mistakes. Thankfully, they were debugged.
If we had solved 3 before freeze time, there was a good chance that we would have got B accepted.
If you were to attend world finals 2015, you have one year now. How would you prepare?
Same as what we did, except with more organized documentation. (We did a good amount of documentation, but not consistently throughout the year). IMO, documentation is essential to organization and prolonged motivation.
Finally, you still want to be active and try to become red on TC/CF or take a break?
Yes. It is high on my list of priorities but definitely lower in priority than the coursework at my University. So, I will pursue it as a hobby in the time that remains after my coursework.
Reading all his answers helped me! Dint that help you?
Archit asked me not to share this image on Facebook. I am a good person, I followed his words. This was when we were having fun @ World Finals 2014!
Let us take this opportunity to congratulate him on his great achievements and thank him for sharing his experience.